From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 09 22:05:46 2013 Received: (at submit) by debbugs.gnu.org; 10 Oct 2013 02:05:46 +0000 Received: from localhost ([127.0.0.1]:39144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VU5dJ-0003L4-OM for submit@debbugs.gnu.org; Wed, 09 Oct 2013 22:05:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52066) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VU5aM-0003GT-Ct for submit@debbugs.gnu.org; Wed, 09 Oct 2013 22:02:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VU5aH-0005T2-6U for submit@debbugs.gnu.org; Wed, 09 Oct 2013 22:02:41 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VU5aH-0005Sw-46 for submit@debbugs.gnu.org; Wed, 09 Oct 2013 22:02:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VU5aC-000100-Iv for bug-coreutils@gnu.org; Wed, 09 Oct 2013 22:02:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VU5a8-0005Rx-3B for bug-coreutils@gnu.org; Wed, 09 Oct 2013 22:02:32 -0400 Received: from contumacia.investici.org ([178.255.144.35]:40040) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VU5a7-0005Rc-Oo for bug-coreutils@gnu.org; Wed, 09 Oct 2013 22:02:28 -0400 Received: from [178.255.144.35] (contumacia [178.255.144.35]) (Authenticated sender: lev.abalkin@insiberia.net) by localhost (Postfix) with ESMTPSA id 846CBE81C7 for ; Thu, 10 Oct 2013 02:02:23 +0000 (UTC) X-DKIM: OpenDKIM Filter v2.6.8 contumacia.investici.org 846CBE81C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=insiberia.net; s=stigmate; t=1381370543; bh=BIMYAnkps5svsI0NJM2Ilh+1Cmg73QVhbLfE35nM5VI=; h=Date:From:To:Subject; b=gWSf92es4ULY4kElhGI06cI6X0Mo0IxASPFiAgjILqpwZ98A1MGx+TaAQ2w2xjsLO F4uOfMIA6xEJ6YaTzeG9tz9dBC/9X7EaX3nA4rNvRSYCygMpT02U+Mtryc1Y8J+9QB pTkUQT7BD+DbuiYAlRR6e0nooSM/ZTPlOUGWWNd0= Message-ID: <52560AA6.7040108@insiberia.net> Date: Thu, 10 Oct 2013 04:02:14 +0200 From: hobo pope User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130922 Icedove/17.0.9 MIME-Version: 1.0 To: bug-coreutils@gnu.org Subject: Bug in documentation on cp Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 09 Oct 2013 22:05:44 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) Dear Team, I think I might have found the following bug in info cp [documentation] The option --preserve=3D offers: " `links' Preserve in the destination files any links between corresponding source files. Note that with `-L' or `-H', this option can convert symbolic links to hard links=E2=80=A6 I've played around a bit, but got different results on "Note that with=20 `-L' or `-H', this option can convert symbolic links to hard links" Using --preserve=3Dlinks with[out] the option -H or -L I get hardlinked=20 files. This happend with GNU coreutils 8.12.197-032bb. I work on Crunchbang Linux [Debian 7], where uname -a -> 3.2.0-4-amd64=20 #1 SMP Debian 3.2.46-1+deb7u1 x86_64 GNU/Linux I've posted two screenshots of this online: with(out) the -H option: http://i.stack.imgur.com/eb8rf.png with(out) the -L option: http://i.stack.imgur.com/U4OUV.png In both cases, I get hard linked files - which is nice, but doesn't=20 accord to the documentation. I didn't wanted to post the images as attachment because I don't know if=20 this is appreciated, but can transmit them if this is helpful. I hope this helped and all the best with a hearfelt thank you for all=20 the good work! A satisfied GNU/Linux user P.S.: A short reply if this was just a misunderstanding from my side or=20 a real bug would be very appreciated. Thank you in advance for all your=20 efforts! From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 10 05:13:17 2013 Received: (at 15579-done) by debbugs.gnu.org; 10 Oct 2013 09:13:17 +0000 Received: from localhost ([127.0.0.1]:39721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VUCJ2-0006WJ-H3 for submit@debbugs.gnu.org; Thu, 10 Oct 2013 05:13:16 -0400 Received: from mail1.vodafone.ie ([213.233.128.43]:19466) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VUCIz-0006W9-67 for 15579-done@debbugs.gnu.org; Thu, 10 Oct 2013 05:13:14 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApQBAPNuVlJtT3WW/2dsb2JhbAANTIM/g3q9d4E1gxkBAQEEIwQLAUYQCQINCwICBRYLAgIJAwIBAgFFBg0BBwEBiA6LDppndZI2gSmOHgeCaoE5A55kjkg Received: from unknown (HELO [192.168.1.79]) ([109.79.117.150]) by mail1.vodafone.ie with ESMTP; 10 Oct 2013 10:13:11 +0100 Message-ID: <52566FA7.7020308@draigBrady.com> Date: Thu, 10 Oct 2013 10:13:11 +0100 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: hobo pope Subject: Re: bug#15579: Bug in documentation on cp References: <52560AA6.7040108@insiberia.net> In-Reply-To: <52560AA6.7040108@insiberia.net> X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 15579-done Cc: 15579-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 10/10/2013 03:02 AM, hobo pope wrote: > Dear Team, > > > I think I might have found the following bug in info cp [documentation] > > The option --preserve= offers: " `links' > Preserve in the destination files any links between > corresponding source files. Note that with `-L' or `-H', > this option can convert symbolic links to hard links… > > I've played around a bit, but got different results on "Note that with `-L' or `-H', this option can convert symbolic links to hard links" > > Using --preserve=links with[out] the option -H or -L I get hardlinked files. > > This happend with GNU coreutils 8.12.197-032bb. > > I work on Crunchbang Linux [Debian 7], where uname -a -> 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1+deb7u1 x86_64 GNU/Linux > > > > I've posted two screenshots of this online: > > with(out) the -H option: http://i.stack.imgur.com/eb8rf.png > with(out) the -L option: http://i.stack.imgur.com/U4OUV.png > > In both cases, I get hard linked files - which is nice, but doesn't accord to the documentation. > > I didn't wanted to post the images as attachment because I don't know if this is appreciated, but can transmit them if this is helpful. > > I hope this helped and all the best with a hearfelt thank you for all the good work! > > > > > A satisfied GNU/Linux user > > P.S.: A short reply if this was just a misunderstanding from my side or a real bug would be very appreciated. Thank you in advance for all your efforts! The docs are a bit terse here. The main issue is that -a implies -d and that implies --no-dereference which is required to get your commands to work as expected. I.E. --no-dereference is required to stop cp implicitly following symlinks in the source. To verify and split out the detail being demonstrated here: $ mkdir links; : > a; ln -s a b; Here we see that -d overrides -H as it comes after. Therefore we will not dereference symlinks in the first place. $ rm links/*; cp -H -d a b links $ l links/ lrwxrwxrwx. 1 padraig 1 Oct 10 09:37 b ▪▶ a -rw-rw-r--. 1 padraig 0 Oct 10 09:37 a Here we see that -H is now honored as it comes last, and therefore symlinks are followed in the source, resulting in hardlinks in the destination. $ rm links/* $ rm links/*; cp -d -H a b links $ l links -rw-rw-r--. 2 padraig 0 Oct 10 09:37 b -rw-rw-r--. 2 padraig 0 Oct 10 09:37 a I'll make the docs a bit more explicit with the following: diff --git a/doc/coreutils.texi b/doc/coreutils.texi index b273627..aeed4ca 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -8257,9 +8257,11 @@ $ mkdir c; : > a; ln -s a b; cp -aH a b c; ls -i1 c @noindent Note the inputs: @file{b} is a symlink to regular file @file{a}, yet the files in destination directory, @file{c/}, are hard-linked. -Since @option{-a} implies @option{--preserve=links}, and since @option{-H} -tells @command{cp} to dereference command line arguments, it sees two files -with the same inode number, and preserves the perceived hard link. +Since @option{-a} implies @option{--no-dereference} it would copy the symlink, +but the later @option{-H} tells @command{cp} to dereference the command line +arguments where it then sees two files with the same inode number. +Then the @option{--preserve=links} option also implied by @option{-a} +will preserve the perceived hard link. thanks, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 10 16:42:57 2013 Received: (at 15579) by debbugs.gnu.org; 10 Oct 2013 20:42:57 +0000 Received: from localhost ([127.0.0.1]:41542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VUN4S-0000lW-Mm for submit@debbugs.gnu.org; Thu, 10 Oct 2013 16:42:56 -0400 Received: from joseki.proulx.com ([216.17.153.58]:53771) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VUN4O-0000lJ-4l for 15579@debbugs.gnu.org; Thu, 10 Oct 2013 16:42:54 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 8E7342123A; Thu, 10 Oct 2013 14:42:47 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 8620C2DCE6; Thu, 10 Oct 2013 14:42:47 -0600 (MDT) Date: Thu, 10 Oct 2013 14:42:47 -0600 From: Bob Proulx To: hobo pope Subject: Re: bug#15579: Bug in documentation on cp Message-ID: <20131010204247.GA22015@hysteria.proulx.com> References: <52560AA6.7040108@insiberia.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52560AA6.7040108@insiberia.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: 15579 Cc: 15579@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) hobo pope wrote: > I've posted two screenshots of this online: > > with(out) the -H option: http://i.stack.imgur.com/eb8rf.png > with(out) the -L option: http://i.stack.imgur.com/U4OUV.png > ... > I didn't wanted to post the images as attachment because I don't > know if this is appreciated, but can transmit them if this is > helpful. Thank you for posting a URL instead of attaching the images. That was more friendly than attaching the images. Except! There is always an except. :-) Except those are images of text. The best thing is simply to post the text. It is almost never appropriate to post images. Images of text are particularly bad. There is never a reason to post images of text. Simply post the text itself. When reporting test cases it is always best to cut and paste the text of the case verbatim. That way the entire thing is small. It is then preserved in the archive. The text of the text is what is desired. With that we can see the test case easily. If the test case is well done then we can cut and paste the test case ourselves out of the mail and into our shell for testing. Bob From unknown Tue Aug 19 10:04:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 08 Nov 2013 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator