{"thread":{"id":"21292","subject":"[PATCH] import-tars: Add support for tarballs compressed with lzma, xz","startedAt":"2009-10-20T08:59:37Z","lastAt":"2009-10-20T10:29:32Z","messageCount":3,"participants":["Ingmar Vanhassel","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"125457","messageId":"1256029177-22503-1-git-send-email-ingmar@exherbo.org","threadId":"21292","inReplyTo":null,"subject":"[PATCH] import-tars: Add support for tarballs compressed with lzma, xz","fromName":"Ingmar Vanhassel","fromEmail":"ingmar@exherbo.org","sentAt":"2009-10-20T08:59:37Z","receivedAt":"2009-10-20T08:59:37Z","isPatch":true,"sender":{"key":"ingmar@exherbo.org","avatar":"https://avatars.githubusercontent.com/u/19112?v=4"},"body":"Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>\n---\n contrib/fast-import/import-tars.perl |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl\nindex 7001862..95438e1 100755\n--- a/contrib/fast-import/import-tars.perl\n+++ b/contrib/fast-import/import-tars.perl\n@@ -20,7 +20,7 @@ use Getopt::Long;\n \n my $metaext = '';\n \n-die \"usage: import-tars [--metainfo=extension] *.tar.{gz,bz2,Z}\\n\"\n+die \"usage: import-tars [--metainfo=extension] *.tar.{gz,bz2,lzma,xz,Z}\\n\"\n \tunless GetOptions('metainfo=s' => \\$metaext) && @ARGV;\n \n my $branch_name = 'import-tars';\n@@ -49,6 +49,9 @@ foreach my $tar_file (@ARGV)\n \t} elsif ($tar_name =~ s/\\.tar\\.Z$//) {\n \t\topen(I, '-|', 'uncompress', '-c', $tar_file)\n \t\t\tor die \"Unable to uncompress -c $tar_file: $!\\n\";\n+\t} elsif ($tar_name =~ s/\\.(tar\\.(lzma|xz)|(tlz|txz))$//) {\n+\t\topen(I, '-|', 'xz', '-dc', $tar_file)\n+\t\t\tor die \"Unable to xz -dc $tar_file: $!\\n\";\n \t} elsif ($tar_name =~ s/\\.tar$//) {\n \t\topen(I, $tar_file) or die \"Unable to open $tar_file: $!\\n\";\n \t} else {\n-- \n1.6.5.1\n"},{"id":"125463","messageId":"alpine.DEB.1.00.0910201155260.4985@pacific.mpi-cbg.de","threadId":"21292","inReplyTo":"1256029177-22503-1-git-send-email-ingmar@exherbo.org","subject":"Re: [PATCH] import-tars: Add support for tarballs compressed with lzma, xz","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-10-20T09:56:47Z","receivedAt":"2009-10-20T09:56:47Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 20 Oct 2009, Ingmar Vanhassel wrote:\n\n> Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>\n\nNice!  Maybe you want to mention in the commit message that it handles \nalso .txz and .tlz, for convenience.  (I was looking specifically for that \nsupport in the patch, fully prepared to suggest to add it...)\n\nCiao,\nDscho\n"},{"id":"125465","messageId":"1256034572-14228-1-git-send-email-ingmar@exherbo.org","threadId":"21292","inReplyTo":"alpine.DEB.1.00.0910201155260.4985@pacific.mpi-cbg.de","subject":"[PATCH] import-tars: Add support for tarballs compressed with lzma, xz","fromName":"Ingmar Vanhassel","fromEmail":"ingmar@exherbo.org","sentAt":"2009-10-20T10:29:32Z","receivedAt":"2009-10-20T10:29:32Z","isPatch":true,"sender":{"key":"ingmar@exherbo.org","avatar":"https://avatars.githubusercontent.com/u/19112?v=4"},"body":"Also handle the extensions .tlz and .txz, aliases for .tar.lzma and\n.tar.xz respectively.\n\nSigned-off-by: Ingmar Vanhassel <ingmar@exherbo.org>\n---\n contrib/fast-import/import-tars.perl |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\n> Nice!  Maybe you want to mention in the commit message that it handles\n> also .txz and .tlz, for convenience.  (I was looking specifically for that\n> support in the patch, fully prepared to suggest to add it...)\n\nRight, thanks!\n\ndiff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl\nindex 7001862..95438e1 100755\n--- a/contrib/fast-import/import-tars.perl\n+++ b/contrib/fast-import/import-tars.perl\n@@ -20,7 +20,7 @@ use Getopt::Long;\n \n my $metaext = '';\n \n-die \"usage: import-tars [--metainfo=extension] *.tar.{gz,bz2,Z}\\n\"\n+die \"usage: import-tars [--metainfo=extension] *.tar.{gz,bz2,lzma,xz,Z}\\n\"\n \tunless GetOptions('metainfo=s' => \\$metaext) && @ARGV;\n \n my $branch_name = 'import-tars';\n@@ -49,6 +49,9 @@ foreach my $tar_file (@ARGV)\n \t} elsif ($tar_name =~ s/\\.tar\\.Z$//) {\n \t\topen(I, '-|', 'uncompress', '-c', $tar_file)\n \t\t\tor die \"Unable to uncompress -c $tar_file: $!\\n\";\n+\t} elsif ($tar_name =~ s/\\.(tar\\.(lzma|xz)|(tlz|txz))$//) {\n+\t\topen(I, '-|', 'xz', '-dc', $tar_file)\n+\t\t\tor die \"Unable to xz -dc $tar_file: $!\\n\";\n \t} elsif ($tar_name =~ s/\\.tar$//) {\n \t\topen(I, $tar_file) or die \"Unable to open $tar_file: $!\\n\";\n \t} else {\n-- \n1.6.5.1\n"}]}