git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] import-tars: Add support for tarballs compressed with lzma, xz
@ 2009-10-20  8:59 Ingmar Vanhassel
  2009-10-20  9:56 ` Johannes Schindelin
  0 siblings, 1 reply; 3+ messages in thread
From: Ingmar Vanhassel @ 2009-10-20  8:59 UTC (permalink / raw)
  To: git; +Cc: Shawn O. Pearce, Peter Krefting, Junio C Hamano, Ingmar Vanhassel

Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
---
 contrib/fast-import/import-tars.perl |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl
index 7001862..95438e1 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 {
-- 
1.6.5.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] import-tars: Add support for tarballs compressed with lzma, xz
  2009-10-20  8:59 [PATCH] import-tars: Add support for tarballs compressed with lzma, xz Ingmar Vanhassel
@ 2009-10-20  9:56 ` Johannes Schindelin
  2009-10-20 10:29   ` Ingmar Vanhassel
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin @ 2009-10-20  9:56 UTC (permalink / raw)
  To: Ingmar Vanhassel; +Cc: git, Shawn O. Pearce, Peter Krefting, Junio C Hamano

Hi,

On Tue, 20 Oct 2009, Ingmar Vanhassel wrote:

> Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>

Nice!  Maybe you want to mention in the commit message that it handles 
also .txz and .tlz, for convenience.  (I was looking specifically for that 
support in the patch, fully prepared to suggest to add it...)

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] import-tars: Add support for tarballs compressed with lzma, xz
  2009-10-20  9:56 ` Johannes Schindelin
@ 2009-10-20 10:29   ` Ingmar Vanhassel
  0 siblings, 0 replies; 3+ messages in thread
From: Ingmar Vanhassel @ 2009-10-20 10:29 UTC (permalink / raw)
  To: git
  Cc: Johannes Schindelin, Shawn O. Pearce, Peter Krefting,
	Junio C Hamano, Ingmar Vanhassel

Also handle the extensions .tlz and .txz, aliases for .tar.lzma and
.tar.xz respectively.

Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
---
 contrib/fast-import/import-tars.perl |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

> Nice!  Maybe you want to mention in the commit message that it handles
> also .txz and .tlz, for convenience.  (I was looking specifically for that
> support in the patch, fully prepared to suggest to add it...)

Right, thanks!

diff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl
index 7001862..95438e1 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 {
-- 
1.6.5.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-20 10:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-20  8:59 [PATCH] import-tars: Add support for tarballs compressed with lzma, xz Ingmar Vanhassel
2009-10-20  9:56 ` Johannes Schindelin
2009-10-20 10:29   ` Ingmar Vanhassel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).