git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Michael Loeffler <zvpunry@zvpunry.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] import-tars: use Archive::Tar instead of unpack()
Date: Wed, 14 Feb 2007 21:51:59 -0500	[thread overview]
Message-ID: <20070215025159.GA29944@spearce.org> (raw)
In-Reply-To: <1171468992.629.68.camel@ibook.zvpunry.de>

Michael Loeffler <zvpunry@zvpunry.de> wrote:
> In the Archive::Tar manpage they use gunzip and uncompress instead of
> zcat or gzcat, so what do you think about the following patch?
> 
> diff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl
> index 990c9e7..5585a8b 100755
> --- a/contrib/fast-import/import-tars.perl
> +++ b/contrib/fast-import/import-tars.perl
> @@ -25,11 +25,14 @@ foreach my $tar_file (@ARGV)
>  	my $tar_name = $1;
>  
>  	if ($tar_name =~ s/\.(tar\.gz|tgz)$//) {
> -		open(I, '-|', 'gzcat', $tar_file) or die "Unable to gzcat $tar_file: $!\n";
> +		open(I, '-|', 'gunzip', '-c', $tar_file)
> +			or die "Unable to gunzip -c $tar_file: $!\n";
>  	} elsif ($tar_name =~ s/\.(tar\.bz2|tbz2)$//) {
> -		open(I, '-|', 'bzcat', $tar_file) or die "Unable to bzcat $tar_file: $!\n";
> +		open(I, '-|', 'bunzip2', '-c', $tar_file)
> +			or die "Unable to bunzip2 -c $tar_file: $!\n";
>  	} elsif ($tar_name =~ s/\.tar\.Z$//) {
> -		open(I, '-|', 'zcat', $tar_file) or die "Unable to zcat $tar_file: $!\n";
> +		open(I, '-|', 'uncompress', '-c', $tar_file)
> +			or die "Unable to uncompress -c $tar_file: $!\n";
>  	} elsif ($tar_name =~ s/\.tar$//) {
>  		open(I, $tar_file) or die "Unable to open $tar_file: $!\n";
>  	} else {

Yes, that's what I should have done initially.  Thanks.  How about
the following message and sbo?

commit 908387056949c0fb8153fbb84f4dbeb6695611e6
Author: Michael Loeffler <zvpunry@zvpunry.de>
Date:   Wed Feb 14 17:03:12 2007 +0100

    Use gunzip -c over gzcat in import-tars example.
    
    Not everyone has gzcat or bzcat installed on their system, but
    gunzip -c and bunzip2 -c perform the same task and are available
    if the user has installed gzip support or bzip2 support.
    
    Signed-off-by: Michael Loeffler <zvpunry@zvpunry.de>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

-- 
Shawn.

  reply	other threads:[~2007-02-15  2:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-12 14:17 [PATCH] import-tars: use Archive::Tar instead of unpack() Michael Loeffler
2007-02-12 14:25 ` Johannes Schindelin
2007-02-12 17:28 ` Shawn O. Pearce
2007-02-14 16:03   ` Michael Loeffler
2007-02-15  2:51     ` Shawn O. Pearce [this message]
     [not found] ` <127B27FE-1F9A-4328-A87A-77B907FFEBA7@zvpunry.de>
2007-04-24 10:13   ` Karl Hasselström
2007-04-24 10:55     ` Sam Vilain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070215025159.GA29944@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=zvpunry@zvpunry.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).