Subject: bug#15173: [cp] --link overrides dereference settings

From: Gian Piero Carrubba <[email-masked]>
Date: Thu, 7 Nov 2013 15:09:01 +0100

* [Thu, Nov 07, 2013 at 10:14:05AM +0000] Pádraig Brady:
>On 11/07/2013 07:07 AM, Bernhard Voelker wrote:
>> Okay, so we're leaving the ground of the GNU extension --link here.
>
>Yes.
>I think the --link case should be considered separately (with and without -R).
>I.E. IMHO your current patch is fine and good.

Fair enough. In this case please also update the documentation.
Maybe something like the following could be enough (please re-word it in order
to let it intelligible) ?

--- old-issue-15173/doc/coreutils.texi  2013-11-07 14:07:35.139997551 +0100
+++ new-issue-15173/doc/coreutils.texi  2013-11-07 14:07:35.143997573 +0100
@@ -8052,8 +8052,8 @@
  to corresponding destination directories.

  When copying from a symbolic link, @command{cp} normally follows the
-link only when not copying
-recursively.  This default can be overridden with the
+link only when not copying recursively or when @option{--link}
+(@option{-l}) is used.  This default can be overridden with the
  @option{--archive} (@option{-a}), @option{-d}, @option{--dereference}
  (@option{-L}), @option{--no-dereference} (@option{-P}), and
  @option{-H} options.  If more than one of these options is specified,
@@ -8327,7 +8327,8 @@
  @cindex recursively copying directories
  @cindex non-directories, copying as special files
  Copy directories recursively.  By default, do not follow symbolic
-links in the source; see the @option{--archive} (@option{-a}), @option{-d},
+links in the source unless used together with the @option{--link}
+(@option{-l}) option; see the @option{--archive} (@option{-a}), @option{-d},
  @option{--dereference} (@option{-L}), @option{--no-dereference}
  (@option{-P}), and @option{-H} options.  Special files are copied by
  creating a destination file of the same type as the source; see the

Ciao,
Gian Piero.