[BusyBox] hard link fix for tar

Bart Visscher magick at Linux-Fan.com
Fri Jul 19 11:35:03 UTC 2002


Hi,

I found a problem in the tar hard link handling, it remembers the hard 
link while the GNU tar does not. Attached patch should fix it.

Example:
$ touch file1
$ ln file1 file2
$ ls -l file*
$ ls -il file*
   14734 -rw-r--r--    2 magick   magick          0 Jul 19 19:14 file1
   14734 -rw-r--r--    2 magick   magick          0 Jul 19 19:14 file2
$ tar cvf test.tar --exclude=file1 file*
file2
$ tar tlvf test.tar -rw-r--r-- magick/magick     0 2002-07-19 19:14:39 
file2
$ echo file1 > exclude
$ busybox tar -c -X exclude -f test.tar file*
$ tar tlvf test.tar tar: Record size = 3 blocks
-rw-r--r-- magick/magick     0 2002-07-19 19:14:39 file2 link to file1

Bart
-- 
mixed emotions:
Watching a bus-load of lawyers plunge off a cliff. With five empty seats.
Fingerprint = CD4D 5601 287D F075 6F96  6157 99F9 E56A 4B08 6D06
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 00-tar_hardlink
Type: text/x-patch
Size: 2149 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20020719/8f002df8/attachment.bin 


More information about the busybox mailing list