coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

`cp -a` has a different behavior that GNU's

Open kevinburkesegment opened this issue 2 years ago • 5 comments

#export C=./target/debug/coreutils
rm -rf dir1 dir2
mkdir dir1 dir2
touch dir1/file
$C cp -a dir1/. dir2
stat dir2/file

With GNU, dir2/file exists. With our implementation, dir2/file doesn't. Instead, the file dir2/dir1/file is created

kevinburkesegment avatar Aug 29 '22 20:08 kevinburkesegment

I think it panicked here: https://github.com/fede1024/rust-rdkafka/blob/master/rdkafka-sys/build.rs#L21

Seems like "cp -a librdkafka/. /Users/kevinburke/src/github.com/kevinburkesegment/k8s-repro/cargo/target/release/build/rdkafka-sys-58ae7d01e1b63d03/out" didn't copy the contents of librdkafka, so it can't find configure inside out: https://github.com/fede1024/rust-rdkafka/blob/master/rdkafka-sys/build.rs#L165

The testcase is:

mkdir dir1 dir2
touch dir1/file
cp -a dir1/. dir2
stat dir2/file

The uutils copies dir1, but GNU copies dir1's contents

niyaznigmatullin avatar Aug 31 '22 06:08 niyaznigmatullin

Thank you!

kevinburkesegment avatar Aug 31 '22 16:08 kevinburkesegment

Indeed, thanks. I cleanup the bug to keep the essential information

sylvestre avatar Aug 31 '22 16:08 sylvestre

Hi, I would like to work on this issue. Already asked on the discord and could try a solution, hope thats ok :)

dmatos2012 avatar Sep 12 '22 06:09 dmatos2012

sure, please give it a try :)

sylvestre avatar Sep 12 '22 06:09 sylvestre