[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] hard links and --transform
From: |
Marius Tolzmann |
Subject: |
Re: [Bug-tar] hard links and --transform |
Date: |
Thu, 30 Jul 2009 18:44:56 +0200 |
User-agent: |
Thunderbird 2.0.0.21 (X11/20090302) |
Hi there..
i just stumbled over the same problem when transforming hardlinks..
the following short patch fixes the problem for me.. (without applying
the previous patch)
since i haven't found a final fix here is my solution just for your
information 8)..
grettings from berlin/germany..
marius tolzmann..
===================================================================
RCS file: src/create.c,v
retrieving revision 1.1
diff -au -r1.1 src/create.c
--- src/create.c 2009/07/30 16:16:51 1.1
+++ src/create.c 2009/07/30 16:26:46
@@ -1397,6 +1397,7 @@
block_ordinal = current_block_ordinal ();
assign_string (&st->link_name, link_name);
+ transform_name(&st->link_name, XFORM_LINK);
if (NAME_FIELD_SIZE - (archive_format == OLDGNU_FORMAT)
< strlen (link_name))
write_long_link (st);
Original Message:
-----------------
Sergey Poznyakoff wrote:
Jose Miguel Goncalves <address@hidden> ha escrit:
I'm facing the same problem reported back in March, 17 by Wouter
Verhelst, regarding storing hard links in tar using --transform.
I'm using tar 1.22.
I must have overlooked the original report. Please, try the attached
patch. Let me know if it works for you.
It works!
$ /usr/local/bin/tar cPvf test.tar --transform="s,^basedir,,h"
--show-stored-names basedir
/
/test
/test_link
$ /usr/local/bin/tar tPvf test.tar
drwxr-xr-x jmpg/jmpg 0 2009-06-25 16:49 /
-rw-r--r-- jmpg/jmpg 6 2009-06-25 13:13 /test
hrw-r--r-- jmpg/jmpg 0 2009-06-25 13:13 /test_link link to /test
But, when I give 'H' in the transformation scope flag it still does the
transformation:
$ /usr/local/bin/tar cvPf test.tar --transform="s,^basedir,,H"
--show-stored-names basedir
/
/test
/test_link
$ /usr/local/bin/tar tPvf test.tar
drwxr-xr-x jmpg/jmpg 0 2009-06-25 16:49 /
-rw-r--r-- jmpg/jmpg 6 2009-06-25 13:13 /test
hrw-r--r-- jmpg/jmpg 0 2009-06-25 13:13 /test_link link to /test
Only if I supply 'R' tar does not make the transformation:
$ /usr/local/bin/tar cPvf test.tar --transform="s,^basedir,,R"
--show-stored-names basedir
basedir/
basedir/test
basedir/test_link
$ /usr/local/bin/tar tPvf test.tar
drwxr-xr-x jmpg/jmpg 0 2009-06-25 16:49 basedir/
-rw-r--r-- jmpg/jmpg 6 2009-06-25 13:13 basedir/test
hrw-r--r-- jmpg/jmpg 0 2009-06-25 13:13 basedir/test_link link to
basedir/test
so, it seems that some bug(s) still persist.
Best regards,
J