On Sat, Aug 07, 2004 at 10:30:14AM +0100, Philip Rowlands wrote:

> On Tue, 3 Aug 2004, Tim Waugh wrote:
> 
> >When using 'cp -a' to copy a directory structure, it has some
> >unexpected behaviour.  See the attached Makefile, which compares the
> >behaviour between tar, cpio, and cp.
> 
> I might be missing something here; I can't reproduce this with a recent
> cp (from FC2):
> 
> $ cp --version
> cp (coreutils) 5.2.1
> $ make -s cp
> $
> 
> The source and dest appear identical, and strace shows cp unlinking
> "1/d/2" and "1/d/3" as it goes.

How odd.  Is that a patched 5.2.1?  Here's what I get with unpatched
5.2.1, straight from the tarball:

[EMAIL PROTECTED] ~/coreutils-5.2.1/src]$ ./cp --version
cp (coreutils) 5.2.1
Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering.

Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[EMAIL PROTECTED] ~/coreutils-5.2.1/src]$ rm -fr 1 2
[EMAIL PROTECTED] ~/coreutils-5.2.1/src]$ mkdir -p 1/d 2/d
[EMAIL PROTECTED] ~/coreutils-5.2.1/src]$ echo foo > 1/d/1
[EMAIL PROTECTED] ~/coreutils-5.2.1/src]$ ln 1/d/1 1/d/2
[EMAIL PROTECTED] ~/coreutils-5.2.1/src]$ ln 1/d/1 1/d/3
[EMAIL PROTECTED] ~/coreutils-5.2.1/src]$ echo foo > 2/d/1
[EMAIL PROTECTED] ~/coreutils-5.2.1/src]$ echo bar > 2/d/2
[EMAIL PROTECTED] ~/coreutils-5.2.1/src]$ ln 2/d/2 2/d/3
[EMAIL PROTECTED] ~/coreutils-5.2.1/src]$ ln 2/d/2 2/d/4
[EMAIL PROTECTED] ~/coreutils-5.2.1/src]$ ./cp -af 2/d 1
[EMAIL PROTECTED] ~/coreutils-5.2.1/src]$ diff -upr 2 1
diff -upr 2/d/1 1/d/1
--- 2/d/1       2004-08-10 13:19:02.695163241 +0100
+++ 1/d/1       2004-08-10 13:19:02.703161000 +0100
@@ -1 +1 @@
-foo
+bar

Tim.
*/

Attachment: pgpZj95vMcJL8.pgp
Description: PGP signature

_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to