From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingmar Vanhassel Subject: [PATCH] import-tars: Add support for tarballs compressed with lzma, xz Date: Tue, 20 Oct 2009 12:29:32 +0200 Message-ID: <1256034572-14228-1-git-send-email-ingmar@exherbo.org> References: Cc: Johannes Schindelin , "Shawn O. Pearce" , Peter Krefting , Junio C Hamano , Ingmar Vanhassel To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Tue Oct 20 12:34:44 2009 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1N0ByL-00080t-Cy for gcvg-git-2@lo.gmane.org; Tue, 20 Oct 2009 12:29:45 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751687AbZJTK3g (ORCPT ); Tue, 20 Oct 2009 06:29:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751504AbZJTK3f (ORCPT ); Tue, 20 Oct 2009 06:29:35 -0400 Received: from bach.exherbo.org ([78.47.197.147]:55309 "EHLO bach.exherbo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751458AbZJTK3f (ORCPT ); Tue, 20 Oct 2009 06:29:35 -0400 Received: from [83.101.72.69] (helo=localhost) by bach.exherbo.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1N0ByC-0002S6-6O; Tue, 20 Oct 2009 10:29:36 +0000 X-Mailer: git-send-email 1.6.5.1 In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Also handle the extensions .tlz and .txz, aliases for .tar.lzma and .tar.xz respectively. Signed-off-by: Ingmar Vanhassel --- 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