summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-10-25 18:40:21 -0700
committerJunio C Hamano <gitster@pobox.com>2009-10-25 18:40:21 -0700
commit18432dfd889061cae4cbfe9b2407ba5851eea60e (patch)
treeefd1ca1a130f9204fe88af38073df3c1da0a4324 /contrib
parentc9155dcc0cfc8f4c03d088ab1575d0a762972a9b (diff)
parent2a94552887ecbaa8b848a92eb607e032d77c8a2c (diff)
downloadgit-18432dfd889061cae4cbfe9b2407ba5851eea60e.tar.gz
Merge branch 'iv/tar-lzma-xz'
* iv/tar-lzma-xz: import-tars: Add support for tarballs compressed with lzma, xz
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/fast-import/import-tars.perl5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl
index 7001862bfd..95438e1ed4 100755
--- a/contrib/fast-import/import-tars.perl
+++ b/contrib/fast-import/import-tars.perl
@@ -20,7 +20,7 @@ use Getopt::Long;
my $metaext = '';
-die "usage: import-tars [--metainfo=extension] *.tar.{gz,bz2,Z}\n"
+die "usage: import-tars [--metainfo=extension] *.tar.{gz,bz2,lzma,xz,Z}\n"
unless GetOptions('metainfo=s' => \$metaext) && @ARGV;
my $branch_name = 'import-tars';
@@ -49,6 +49,9 @@ foreach my $tar_file (@ARGV)
} elsif ($tar_name =~ s/\.tar\.Z$//) {
open(I, '-|', 'uncompress', '-c', $tar_file)
or die "Unable to uncompress -c $tar_file: $!\n";
+ } elsif ($tar_name =~ s/\.(tar\.(lzma|xz)|(tlz|txz))$//) {
+ open(I, '-|', 'xz', '-dc', $tar_file)
+ or die "Unable to xz -dc $tar_file: $!\n";
} elsif ($tar_name =~ s/\.tar$//) {
open(I, $tar_file) or die "Unable to open $tar_file: $!\n";
} else {