Skip to content

mv: gnu test case part-symlink compatibility  #6587

@matrixhead

Description

@matrixhead

This GNU test is a shared test for mv and cp that mainly checks the inter-partition copying of both utilities when a symlink is involved. mv is already fully compatible with this test case, but in the case of cp, the test is failing, not because of anything related to inter-partition copying but because of how uu-cp handles symlink destinations when --rem and --backup are given.

For example

echo xyz > loc_reg
mkdir innerdir
echo abc > innerdir/innerfile
ln -sr innerdir/innerfile innerdir/sl
cp --rem -b loc_reg innerdir/sl

this should give us

>> ls -l innerdir
total 8
-rw-r--r-- 1 mhead mhead 4 Jul 20 19:03 innerfile
-rw-r--r-- 1 mhead mhead 4 Jul 20 19:07 sl
lrwxrwxrwx 1 mhead mhead 9 Jul 20 19:03 sl~ -> innerfile

What cp did was back up the symlink, remove the symlink at the destination path, and then copy the source file to that path. However, in uu-cp's case, this would produce an error saying cp: No such file or directory (os error 2), and inside the innerdir, it would look like this:

» ls -l innerdir
total 4
-rw-r--r-- 1 mhead mhead 4 Jul 20 19:15 innerfile
lrwxrwxrwx 1 mhead mhead 9 Jul 20 19:15 sl~ -> innerfile

After backing up and removing the symlink, uu-cp failed to copy the source to the destination.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions