"bug|gnu...@nanl.de" <bug|gnu...@nanl.de> wrote:

> However what I'm experiencing is - while -h indeed does not preserve the
> symlinks - it replaces them with hard links instead of actually
> de-referencing them and including the original file.
>
> This in particular is an issue, if you want to create a tarball for a
> filesystem which doesn't support any of such link types - e.g. FAT.
>
> So when extracting the tarball (created with -h) on a FAT filesystem,
> I'm experiencing errors like:
>
> tar: dir/target: Cannot hard link to ?dir/origin?: Operation not permitted
>
> And nothing ends up where a symlink was present when creating the archive.

Given that this is a common problem on non-POSIX platforms, 20 years ago star
introduced support to unpack archives on non-POSIX platforms by using the 
options:

-copylinks

-copyhardlinks

-copysymlinks

-copydlinks

See star man page http://schilytools.sourceforge.net/man/man1/star.1.html
the related parts are currently on page 17.

There is also the option

-hardlinks

see page 33, that tells star to unpack symlinks as hardlinks, which works
on platforms like BeOS or Haiku.

And finally, there is 

-link-data

see page 35, which is allowed for the POSIX.1-1988 TAR archive format and later 
versions. -link-data tells star to archive the data again for hardlinkes files.

Jörg

-- 
 EMail:jo...@schily.net                    (home) Jörg Schilling D-13353 Berlin
    joerg.schill...@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
 URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/'

Reply via email to