Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cp: --remove-destination + --attributes-only should copy symlinks #2926

Open
jtracey opened this issue Jan 27, 2022 · 3 comments
Open

cp: --remove-destination + --attributes-only should copy symlinks #2926

jtracey opened this issue Jan 27, 2022 · 3 comments
Labels

Comments

@jtracey
Copy link
Contributor

jtracey commented Jan 27, 2022

This is causing the latest version of the tests/cp/attr-existing GNU test to fail.

@water-ghosts
Copy link
Contributor

I can give this a shot

@water-ghosts
Copy link
Contributor

water-ghosts commented Jan 30, 2022

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.

@cre4ture
Copy link
Contributor

Is there a reason why this topic got lost 2 years ago?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants