bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] hard links and --transform


From: Wouter Verhelst
Subject: [Bug-tar] hard links and --transform
Date: Tue, 17 Mar 2009 10:23:38 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hi,

I'm trying to build a tar file from a chroot environment, like so:

tar cvzf "$TARFILE" --transform "s,${basedir#/}/,," $basedir

the idea being that "$basedir" (which contains the output of "mktemp
-d") is stripped off of archive member names, while not having to rely
on a chdir() operation, since $TARFILE is the output of my script and as
such may contain a relative pathname rather than an absolute one (its
name is specified by the user).

This works, but not for hardlinked member names. Consider the following:

hrwxr-xr-x root/root    0 2008-10-13 05:33 sbin/fsck.ext2 link to 
tmp/tmp.cZSZPbrxok/sbin/fsck.ext4

Obviously, when extracting this archive, the fsck.ext2 hardlink isn't
createed, because the referenced filename does not exist. I can work
around that using --hardlink-dereference, but I'd rather not, of course.

This is either a bug in documentation (if it's intended behaviour, the
documentation on the --transform option does not say this) or an actual
bug in tar (if the behaviour is not intended, which I suspect).

Regards,

-- 
<Lo-lan-do> Home is where you have to wash the dishes.
  -- #debian-devel, Freenode, 2004-09-22

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]