symbolic links

pax substitution and relative symbolic links

When using pax -s to rewrite archived files on the fly, it also rewrites the symlink reference even if these symlinks are relative. This is highly unexpected, not documented and incorrect behavior.

Imagine you the following two files:

sbin/test -> ../bin/test

If you would archive this using:

find . | pax -d -w -x ustar -s ',^,foo-1.2/,' >foo-1.2.tar

You end up with the following files in the archive:

foo-1.2/sbin/test -> foo-1.2/../bin/test