GNU bug report logs - #23120
cp with --dereference (-L) and --link (-l) or --symbolic-link (-s)

Previous Next

Package: coreutils;

Reported by: Petr Skočík <pskocik <at> gmail.com>

Date: Sat, 26 Mar 2016 13:55:01 UTC

Severity: normal

Tags: fixed

Merged with 15173

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23120 in the body.
You can then email your comments to 23120 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#23120; Package coreutils. (Sat, 26 Mar 2016 13:55:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petr Skočík <pskocik <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sat, 26 Mar 2016 13:55:01 GMT) Full text and rfc822 format available.

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

From: Petr Skočík <pskocik <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: cp with --dereference (-L) and --link (-l) or --symbolic-link (-s)
Date: Sat, 26 Mar 2016 11:36:15 +0100
Hi,

I'm on a system with cp 8.21, and when I do `cp -Ll` or `cp -Ls` on a
symlink, it hardlinks (-Ll) or symlinks (-Ls) the symlink instead of the
target of the symlink.

It behaves the same on single files and trees (with `-r`).

I think the logical thing to do would be for to `cp` to symlink or
hardlink the symlink target in these cases.

What do you think?

Best regards,
Petr.

(
My particular use case is that I'd like to turn a part of an augmented
tree of symlinks (created with `cp -s` + additional file creation on top
of that) into a tree of hardlinks to the sources.
)





Information forwarded to bug-coreutils <at> gnu.org:
bug#23120; Package coreutils. (Sat, 26 Mar 2016 17:27:02 GMT) Full text and rfc822 format available.

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

From: Pádraig Brady <P <at> draigBrady.com>
To: Petr Skočík <pskocik <at> gmail.com>, 23120 <at> debbugs.gnu.org
Subject: Re: bug#23120: cp with --dereference (-L) and --link (-l) or
 --symbolic-link (-s)
Date: Sat, 26 Mar 2016 17:26:36 +0000
unarchive 15173
stop

On 26/03/16 10:36, Petr Skočík wrote:
> Hi,
>
> I'm on a system with cp 8.21, and when I do `cp -Ll` or `cp -Ls` on a
> symlink, it hardlinks (-Ll) or symlinks (-Ls) the symlink instead of the
> target of the symlink.
>
> It behaves the same on single files and trees (with `-r`).
>
> I think the logical thing to do would be for to `cp` to symlink or
> hardlink the symlink target in these cases.
>
> What do you think?
>
> Best regards,
> Petr.
>
> (
> My particular use case is that I'd like to turn a part of an augmented
> tree of symlinks (created with `cp -s` + additional file creation on top
> of that) into a tree of hardlinks to the sources.
> )

The -Ll hardlink case was fixed in 8.22 with a bit of
an epic discussion in http://bugs.gnu.org/15173

The -Ls symlink case currently just symlinks the source symlink.
To link the target you'd have to do similar processing to that
done in `ln -r` and `realpath ...`.  I've not thought about it
enough to know if it was a good idea to add to cp.
There may be enough options for symlink handling to keep
those options in separate tools like discussed in the
--relative option description in the ln manual:
http://www.gnu.org/software/coreutils/ln

cheers,
Pádraig.





Information forwarded to bug-coreutils <at> gnu.org:
bug#23120; Package coreutils. (Sat, 27 Oct 2018 22:09:01 GMT) Full text and rfc822 format available.

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

From: Assaf Gordon <assafgordon <at> gmail.com>
To: 23120 <at> debbugs.gnu.org
Subject: Re: bug#23120: cp with --dereference (-L) and --link (-l) or
 --symbolic-link (-s)
Date: Sat, 27 Oct 2018 16:08:49 -0600
unarchive 15173
merge 23120 15173
tags  23120 fixed
close  23120
stop

(triaging old bugs)

On 2016-03-26 11:26 a.m., Pádraig Brady wrote:
> 
> On 26/03/16 10:36, Petr Skočík wrote:
>>
>> I'm on a system with cp 8.21, and when I do `cp -Ll` or `cp -Ls` on a
>> symlink, it hardlinks (-Ll) or symlinks (-Ls) the symlink instead of the
>> target of the symlink.
>>
> 
> The -Ll hardlink case was fixed in 8.22 with a bit of
> an epic discussion in http://bugs.gnu.org/15173
> 
> The -Ls symlink case currently just symlinks the source symlink.

With no further comments in 2 years, I'm closing this bug.

-assaf





Added tag(s) fixed. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 27 Oct 2018 22:09:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 23120 <at> debbugs.gnu.org and Petr Skočík <pskocik <at> gmail.com> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 27 Oct 2018 22:09:02 GMT) Full text and rfc822 format available.

Merged 15173 23120. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 27 Oct 2018 22:11:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 25 Nov 2018 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 205 days ago.

Previous Next


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