Merge branch 'maint' of git://repo.or.cz/git/fastimport into maint
authorJunio C Hamano <junkio@cox.net>
Wed, 2 May 2007 18:00:16 +0000 (11:00 -0700)
committerJunio C Hamano <junkio@cox.net>
Wed, 2 May 2007 18:00:16 +0000 (11:00 -0700)
* 'maint' of git://repo.or.cz/git/fastimport:
Teach import-tars about GNU tar's @LongLink extension.

contrib/fast-import/import-tars.perl
index 82a90429c8e1a1095851fc706bd456466da40008..e46492048c75f4a3cda11c3bf7ca03889640e7b7 100755 (executable)
                        Z8 Z1 Z100 Z6
                        Z2 Z32 Z32 Z8 Z8 Z*', $_;
                last unless $name;
+               if ($name eq '././@LongLink') {
+                       # GNU tar extension
+                       if (read(I, $_, 512) != 512) {
+                               die ('Short archive');
+                       }
+                       $name = unpack 'Z257', $_;
+                       next unless $name;
+
+                       my $dummy;
+                       if (read(I, $_, 512) != 512) {
+                               die ('Short archive');
+                       }
+                       ($dummy, $mode, $uid, $gid, $size, $mtime,
+                       $chksum, $typeflag, $linkname, $magic,
+                       $version, $uname, $gname, $devmajor, $devminor,
+                       $prefix) = unpack 'Z100 Z8 Z8 Z8 Z12 Z12
+                       Z8 Z1 Z100 Z6
+                       Z2 Z32 Z32 Z8 Z8 Z*', $_;
+               }
                next if $name =~ m{/\z};
                $mode = oct $mode;
                $size = oct $size;