Use gunzip -c over gzcat in import-tars example.
authorMichael Loeffler <zvpunry@zvpunry.de>
Wed, 14 Feb 2007 16:03:12 +0000 (17:03 +0100)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 21 Feb 2007 16:09:57 +0000 (11:09 -0500)
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>
contrib/fast-import/import-tars.perl
index 990c9e70b280fe85bc01869312114f677ee0647d..5585a8b2c575f92e6154e03641b467e5e54509f4 100755 (executable)
        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 {