GNU bug report logs - #15173
[cp] --link overrides dereference settings

Previous Next

Package: coreutils;

Reported by: Gian Piero Carrubba <gpiero <at> rm-rf.it>

Date: Fri, 23 Aug 2013 21:55:02 UTC

Severity: normal

Tags: fixed

Merged with 23120

Done: Bernhard Voelker <mail <at> bernhard-voelker.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Gian Piero Carrubba <gpiero <at> rm-rf.it>
To: Bernhard Voelker <mail <at> bernhard-voelker.de>
Cc: Eric Blake <eblake <at> redhat.com>, Pádraig Brady <P <at> draigBrady.com>, 15173 <at> debbugs.gnu.org
Subject: bug#15173: [cp] --link overrides dereference settings
Date: Thu, 31 Oct 2013 22:28:47 +0100
[Message part 1 (text/plain, inline)]
* [Thu, Oct 31, 2013 at 02:54:59PM +0100] Gian Piero Carrubba:
>Oh... I was tweaking a bit the last patch posted by Bernhard in order 
>to let it be POSIX compliant (but now I have to add: "for my 
>interpretation of POSIX"), but didn't had the time to complete before 
>going to work.  Will probably finish it up anyway this evening or 
>tomorrow, at this point at least for comparing how far we're currently 
>are from "POSIX".

Here it is.
First of all, sorry for having generated a lot of noise. I completely 
misunderstood the meaning of --no-preserve=links. Having get rid of 
that, the differences in the results of the tests are a lot less.

$ fgrep "DIFFERENCE in Test: " testit.log | sed 's/^.*: //'
cp  -l   filelink ...
cp  -l  --preserve=links filelink ...
cp -L -l   filelink ...
cp -L -l  --preserve=links filelink ...
cp -L -l -R  filelink ...
cp -L -l -R --preserve=links filelink ...
cp -H -l   filelink ...
cp -H -l  --preserve=links filelink ...
cp -H -l -R  filelink ...
cp -H -l -R --preserve=links filelink ...

I think they are all legit (full log and differences summary attached).

* Changes with regard to the last patch posted by Bernhard.

=== Minor changes

- use 'dereference' instead of 'deref' in order to be consistent with 
  'x->dereference' and for passing the "grep test"[0]
- use 'command_line_arg' instead of 'cli_arg' in order to be consistent 
  with an already used variable and for passing the "grep test"
- move up the declaration of bool dereference in order to use it for 
  every invocation of create_hard_link()
- clean up the initialization of 'flags' in create_hard_link()

[0] i.e.: http://jamie-wong.com/2013/07/12/grep-test/

=== Major changes

- dereference by default (i.e.: unless --no-dereference is used) the 
  source files.
  I promise that I will not insist anymore :), but I really think this 
  is important for consistency from a user point of view.

Ciao,
Gian Piero.
[bug-15173.patch (text/x-diff, attachment)]
[testit-differences-summary.log.gz (application/octet-stream, attachment)]
[testit.log.gz (text/plain, attachment)]

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

Previous Next


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