coreutils
coreutils copied to clipboard
cp: `--remove-destination` + `--attributes-only` should copy symlinks
This is causing the latest version of the tests/cp/attr-existing GNU test to fail.
I can give this a shot
I think --remove-destination is a red herring, and the issue here is how the flags -a and --attributes-only interact.
printf '1' > file1
ln -s file1 sym1
cp --attributes-only sym1 file2 && test -L file2 # GNU: 1, UUtils: 1
cp -a sym1 file3 && test -L file3 # GNU: 0, UUtils: 0
cp -a --attributes-only sym1 file4 && test -L file4 # GNU: 0, UUtils: 1
GNU seems to give -a priority over --attributes-only when copying a symlink, while UUtils seems to give --attributes-only priority. I'll work on a fix for this issue, and we can see if that fixes the GNU tests.
Is there a reason why this topic got lost 2 years ago?