GNU bug report logs -
#10471
Severe or critical - deletes existing files and leaves nothing. (cp)
Previous Next
Reported by: Linda Walsh <coreutils <at> tlinx.org>
Date: Tue, 10 Jan 2012 00:13:01 UTC
Severity: normal
Tags: notabug
Merged with 10468
Done: Linda Walsh <coreutils <at> tlinx.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Please do not close this bug... EB doesn't know what he is talking
about -- he didn't read the bug.
-------- Original Message --------
Subject: BUG: Severe or critical - deletes existing files and leaves nothing. (cp)
Date: Mon, 09 Jan 2012 13:19:43 -0800
From: Linda Walsh , <cygwin <at> tlinx.org> <coreutils <at> tlinx.org>
To: bug-coreutils <at> gnu.org
CC: cygwin <at> cygwin.com <cygwin <at> cygwin.com>
I was trying to copy a font dir from a unix to a windows machine.
Problem is there are duplicates -- where only the case differs...
On unix, I've run a 'dedup' in my font dir, that joined any files that were the
same so they are hard links to each other. (made sense at the time... ;-) ).
windows treats different cased file names as the same.
Along comes cp, on cygwin, .. but I don't think this is a cygwin bug, as
it's doing what it is supposed to do.. it is cp that is problematic.
Note, in the below, I an alias for cp is in effect:
alias cp='cp --preserve=mode,timestamps'
i.e. by default, I try to preserve 'simple'-permissions, and timestamps.
First I tried:
/usr/share/fonts> cp -avu //bliss/usr_share/fonts/. .
Got:
removed `././Adobe (afm) fonts/Symbol.afm'
cp: cannot create hard link `././Adobe (afm) fonts/Symbol.afm' to `././Adobe
(afm) fonts/symbol.afm': No such file or directory
removed `././Adobe (afm) fonts/cmr10.afm'
cp: cannot create hard link `././Adobe (afm) fonts/cmr10.afm' to `././Adobe
(afm) fonts/CMR10.afm': No such file or directory
removed `././Adobe (afm) fonts/cmex10.afm'
(and many more... )
It removes an existing file 'Symbol', because because it sees that 'Symbol' is not
a hard link to 'symbol'; I specified "-a" to make an exact copy, so it's trying
to copy links.
But by removing 'Symbol', it removes 'symbol' and THEN can't link to it...
thus 'symbol' is gone from the local dir.
---
ok, at this point, I would consider it 'my bad, for using cp on windows (it used
to work without these issues, not sure what has changed)...
Then I tried the less strict:
> cp -rvu /usr/share/fonts> cp -rvu //bliss/usr_share/fonts/. .
figuring without the "-a" it wouldn't try to force linking, thus no prob... ...
well...
removed `././OTF/AJensonPro-Bold.otf'
cp: cannot create hard link `././OTF/AJensonPro-Bold.otf' to
`././OTF/ajensonpro-bold.otf': No such file or directory
removed `././OTF/AJensonPro-BoldCapt.otf'
cp: cannot create hard link `././OTF/AJensonPro-BoldCapt.otf' to
`././OTF/ajensonpro-boldcapt.otf': No such file or directory
removed `././OTF/AJensonPro-BoldDisp.otf'
------
?!!?! Why is it trying to create hard links again? I didn't specify preserve
links!?!
(i.e. this is a cp BUG...)
Well if I could just get it to copy them and not try to link them... so it
copies them twice..
at least they get here...
so I try the only thing that might not remove files "n":
cp -nrvu //bliss/usr_share/fonts/. .
and...
removed `././Adobe (afm) fonts/cmbx5.afm'
cp: cannot create hard link `././Adobe (afm) fonts/cmbx5.afm' to `././Adobe
(afm) fonts/CMBX5.afm': No such file or directory
removed `././Adobe (afm) fonts/cmbx7.afm'
cp: cannot create hard link `././Adobe (afm) fonts/cmbx7.afm' to `././Adobe
(afm) fonts/CMBX7.afm': No such file or directory
removed `././Adobe (afm) fonts/cmmi10.afm'
... *sigh*...
my poor cumberland fonts... so sad!
um.... hey, if it shouldn't have removed them on -rvu, it doubly shouldn't have
done so on
when I told it "-n" (--no-clobber) don't clobber existing files...
DOUBLE BUG!....
cygcheck -f /bin/cp
coreutils-8.14-1
This bug report was last modified 10 years and 48 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.