GNU bug report logs - #8374
cp -a [-l] sometimes does not preserve timestamps of symlinks

Previous Next

Package: coreutils;

Reported by: Ruediger Meier <ruediger.meier <at> ga-group.nl>

Date: Tue, 29 Mar 2011 16:31:01 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 8374 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Ruediger Meier <ruediger.meier <at> ga-group.nl>
Cc: 8374 <at> debbugs.gnu.org, Eric Blake <eblake <at> redhat.com>
Subject: Re: bug#8374: cp -a [-l] sometimes does not preserve timestamps of
	symlinks
Date: Fri, 01 Apr 2011 12:08:55 +0100
[Message part 1 (text/plain, inline)]
On 31/03/11 15:11, Pádraig Brady wrote:
> On 29/03/11 14:46, Ruediger Meier wrote:
>> Hi,
>>
>>
>> I see you fixed that already for for cp -a
>> http://marc.info/?t=124897089600001&r=1&w=2
>>
>> But it does not together with option -link:
>>
>> cd /tmp/
>> ln -s somewhere symlink
>> touch -h -t "197001010000"  symlink
>> cp -a symlink symlink-a
>> cp -al symlink symlink-al
>> ls -l symlink*
>> lrwxrwxrwx 1 rudi users 9 1970-01-01 00:00 symlink -> somewhere
>> lrwxrwxrwx 1 rudi users 9 1970-01-01 00:00 symlink-a -> somewhere
>> lrwxrwxrwx 1 rudi users 9 2011-03-29 13:44 symlink-al -> somewhere
>>
>>
>> I'm using core utils coreutils 8.9 (opensuse 11.4).
>>
>> BTW with coreutils 7.1 and 6.9 it behaves the other way, -al is correct 
>> but -a not.
>>
>> So probably -al is broken since you fixed -a in 7.5.
> 
> Hmm it looks now like we're creating symlinks (with wrong timestamps),
> but in fact we should be creating hardlinks to symlinks.
> 
> This seems to have been changed with:
> http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commit;h=3346c0af

That commit didn't actually change the logic as far as I can see.
It was actually ca9e212c that introduced the logic bug I think.

So I'm going to apply the attached.

cheers,
Pádraig.
[cp-al-timestamps.diff (text/x-patch, attachment)]

This bug report was last modified 14 years and 55 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.