GNU bug report logs - #8381
cp inconsistency

Previous Next

Package: coreutils;

Reported by: Thomas Hofmann <thomas <at> savoy-truffle.de>

Date: Wed, 30 Mar 2011 12:30:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Thomas Hofmann <thomas <at> savoy-truffle.de>
Subject: bug#8381: closed (Re: bug#8381: cp inconsistency)
Date: Wed, 30 Mar 2011 14:12:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#8381: cp inconsistency

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 8381 <at> debbugs.gnu.org.

-- 
8381: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8381
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Pádraig Brady <P <at> draigBrady.com>
To: 8381-done <at> debbugs.gnu.org
Subject: Re: bug#8381: cp inconsistency
Date: Wed, 30 Mar 2011 15:10:43 +0100
On 30/03/11 12:56, Thomas Hofmann wrote:
> Hello,
> 
> two issues:
> 1) manpage of cp contains obsolete email-address for bug-reporting

That is fixed in current versions

> 2) cp inconsistency when copying a directory to a) a non existing
> directory, or b) to an existing directory. Further elaborated below.
> 
> cp -a SOME_DIR NOT_YET_EXISTING_DIR
> 
> results in a new directory directly containing each entry of SOME_DIR
> 
> while:
> CP -a SOME_DIR EXISTING_DIR
> 
> results in EXISTING_DIR/SOME_DIR
> 
> The first result seems to be a reasonable outcome in both cases.
> Appending "/" to the directory-names should lead to the same result.
> While appending "/." to the target-directory would change the meaning,
> and rather lead to the result of the observed second version.

So you would like

cp -a dir dest_dir  # copy dir/* to dest_dir/
cp -a dir dest_dir/ # copy dir to dest_dir/

That seems a bit subtle to me.
Currently one can get the first behavior using `cp -aT`
so I'll close this.

Note also the related:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7450

cheers,
Pádraig.

[Message part 3 (message/rfc822, inline)]
From: Thomas Hofmann <thomas <at> savoy-truffle.de>
To: bug-coreutils <at> gnu.org
Subject: Re: cp inconsistency
Date: Wed, 30 Mar 2011 13:56:08 +0200
Hello,

two issues:
1) manpage of cp contains obsolete email-address for bug-reporting
2) cp inconsistency when copying a directory to a) a non existing
directory, or b) to an existing directory. Further elaborated below.

cp -a SOME_DIR NOT_YET_EXISTING_DIR

results in a new directory directly containing each entry of SOME_DIR

while:
CP -a SOME_DIR EXISTING_DIR

results in EXISTING_DIR/SOME_DIR

The first result seems to be a reasonable outcome in both cases.
Appending "/" to the directory-names should lead to the same result.
While appending "/." to the target-directory would change the meaning,
and rather lead to the result of the observed second version.

Kind regards,
Thomas

p.s. cp (GNU coreutils) 7.1



This bug report was last modified 14 years and 57 days ago.

Previous Next


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