Skip to content

Commit c750da2

Browse files
zvpunryspearce
authored andcommitted
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>
1 parent 3efb1f3 commit c750da2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

contrib/fast-import/import-tars.perl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@
2525
my $tar_name = $1;
2626

2727
if ($tar_name =~ s/\.(tar\.gz|tgz)$//) {
28-
open(I, '-|', 'gzcat', $tar_file) or die "Unable to gzcat $tar_file: $!\n";
28+
open(I, '-|', 'gunzip', '-c', $tar_file)
29+
or die "Unable to gunzip -c $tar_file: $!\n";
2930
} elsif ($tar_name =~ s/\.(tar\.bz2|tbz2)$//) {
30-
open(I, '-|', 'bzcat', $tar_file) or die "Unable to bzcat $tar_file: $!\n";
31+
open(I, '-|', 'bunzip2', '-c', $tar_file)
32+
or die "Unable to bunzip2 -c $tar_file: $!\n";
3133
} elsif ($tar_name =~ s/\.tar\.Z$//) {
32-
open(I, '-|', 'zcat', $tar_file) or die "Unable to zcat $tar_file: $!\n";
34+
open(I, '-|', 'uncompress', '-c', $tar_file)
35+
or die "Unable to uncompress -c $tar_file: $!\n";
3336
} elsif ($tar_name =~ s/\.tar$//) {
3437
open(I, $tar_file) or die "Unable to open $tar_file: $!\n";
3538
} else {

0 commit comments

Comments
 (0)