bug#10686: mv: moving hardlink of a softlink to the softlink does nothing

2012-02-12 Thread Jim Meyering
Eric Blake wrote: On 02/11/2012 04:23 AM, Jim Meyering wrote: +++ b/NEWS ... + mv A B could succeed, yet A would remain. This would happen only when + both A and B were hard links to the same symlink, and with a kernel for + which rename(A,B) would do nothing and return 0. Now, in this

bug#10686: mv: moving hardlink of a softlink to the softlink does nothing

2012-02-11 Thread Jim Meyering
Jim Meyering wrote: The above wasn't quite right in that it failed to honor mv's --backup option. mv --backup s f would not have created the required backup file. I've adjusted it to fix that, and added tests to cover both cases. This is still not quite ready (i.e., the FIXME comment, where

bug#10686: mv: moving hardlink of a softlink to the softlink does nothing

2012-02-11 Thread Eric Blake
On 02/11/2012 04:23 AM, Jim Meyering wrote: +++ b/NEWS @@ -11,6 +11,11 @@ GNU coreutils NEWS-*- outline -*- referent, there is no risk of data loss, since the symlink will typically still point to one of the hard links. + mv A B could succeed,

bug#10686: mv: moving hardlink of a softlink to the softlink does nothing

2012-02-07 Thread Bernhard Voelker
On 02/07/2012 11:45 AM, Michael Felt wrote: Just reading - for reference only - AIX 5.3, and I expect new versions behave as follows (second link becomes a hardlink to original file, mv removes one hard link, i.e. original file (as inode) remains. root@x105:[/tmp/test]touch f

bug#10686: mv: moving hardlink of a softlink to the softlink does nothing

2012-02-06 Thread Bernhard Voelker
On 02/04/2012 04:49 PM, Jim Meyering wrote: The above wasn't quite right in that it failed to honor mv's --backup option. mv --backup s f would not have created the required backup file. I've adjusted it to fix that, and added tests to cover both cases. This is still not quite ready (i.e.,

bug#10686: mv: moving hardlink of a softlink to the softlink does nothing

2012-02-04 Thread Jim Meyering
Jim Meyering wrote: Eric Blake wrote: On 02/01/2012 05:47 AM, Jim Meyering wrote: Bernhard Voelker wrote: Playing around with the latest mv checkin, I noticed another corner case: Create a file 'f', a symlink 'l' to it, and then a hardlink 's' to that symlink: $ touch f ln -s f l

bug#10686: mv: moving hardlink of a softlink to the softlink does nothing

2012-02-01 Thread Bernhard Voelker
Playing around with the latest mv checkin, I noticed another corner case: Create a file 'f', a symlink 'l' to it, and then a hardlink 's' to that symlink: $ touch f ln -s f l ln l s ls -ogi total 0 6444 -rw-r--r-- 1 0 Feb 1 08:52 f 6462 lrwxrwxrwx 2 1 Feb 1 08:52 l - f 6462

bug#10686: mv: moving hardlink of a softlink to the softlink does nothing

2012-02-01 Thread Bernhard Voelker
On 02/01/2012 09:21 AM, Bernhard Voelker wrote: $ touch f ln -s f l ln l s ls -ogi total 0 6444 -rw-r--r-- 1 0 Feb 1 08:52 f 6462 lrwxrwxrwx 2 1 Feb 1 08:52 l - f 6462 lrwxrwxrwx 2 1 Feb 1 08:52 s - f Trying to mv the hardlink over the symlink seems to succeed: $

bug#10686: mv: moving hardlink of a softlink to the softlink does nothing

2012-02-01 Thread Jim Meyering
Bernhard Voelker wrote: Playing around with the latest mv checkin, I noticed another corner case: Create a file 'f', a symlink 'l' to it, and then a hardlink 's' to that symlink: $ touch f ln -s f l ln l s ls -ogi total 0 6444 -rw-r--r-- 1 0 Feb 1 08:52 f 6462 lrwxrwxrwx 2 1

bug#10686: mv: moving hardlink of a softlink to the softlink does nothing

2012-02-01 Thread Bernhard Voelker
On 02/01/2012 01:47 PM, Jim Meyering wrote: Bernhard Voelker wrote: Playing around with the latest mv checkin, I noticed another corner case: Create a file 'f', a symlink 'l' to it, and then a hardlink 's' to that symlink: $ touch f ln -s f l ln l s ls -ogi total 0 6444

bug#10686: mv: moving hardlink of a softlink to the softlink does nothing

2012-02-01 Thread Jim Meyering
Bernhard Voelker wrote: ... well, if it's not standardized (yet), then I agree with you that we should choose the simpler b) alternative. Do you think it's work thinking about the -f case? $ ~/git/coreutils/src/mv -f s l /home/berny/git/coreutils/src/mv: ā€˜sā€™ and ā€˜lā€™ are the same file

bug#10686: mv: moving hardlink of a softlink to the softlink does nothing

2012-02-01 Thread Bernhard Voelker
On 02/01/2012 03:02 PM, Jim Meyering wrote: Bernhard Voelker wrote: ... well, if it's not standardized (yet), then I agree with you that we should choose the simpler b) alternative. Do you think it's work thinking about the -f case? $ ~/git/coreutils/src/mv -f s l

bug#10686: mv: moving hardlink of a softlink to the softlink does nothing

2012-02-01 Thread Eric Blake
On 02/01/2012 05:47 AM, Jim Meyering wrote: Bernhard Voelker wrote: Playing around with the latest mv checkin, I noticed another corner case: Create a file 'f', a symlink 'l' to it, and then a hardlink 's' to that symlink: $ touch f ln -s f l ln l s ls -ogi total 0 6444

bug#10686: mv: moving hardlink of a softlink to the softlink does nothing

2012-02-01 Thread Jim Meyering
Eric Blake wrote: On 02/01/2012 05:47 AM, Jim Meyering wrote: Bernhard Voelker wrote: Playing around with the latest mv checkin, I noticed another corner case: Create a file 'f', a symlink 'l' to it, and then a hardlink 's' to that symlink: $ touch f ln -s f l ln l s ls -ogi

bug#10686: mv: moving hardlink of a softlink to the softlink does nothing

2012-02-01 Thread Jim Meyering
Bernhard Voelker wrote: On 02/01/2012 04:45 PM, Jim Meyering wrote: Thanks for the clarification and quotes, Eric. Bernhard, here's a better patch. With it, mv simply unlinks the s in your example: diff --git a/src/copy.c b/src/copy.c index 4810de8..73f5cc5 100644 --- a/src/copy.c +++