The bug still persists in the 5.8.1-distributed release (1.76_01), and
the above fix by roland.bauer@gmx.at only fixes the problem for tar.exe
and not for gzip.exe .
My below patch also (tries to) fix tar.exe and/or gzip.exe living in a
directory with spaces in the path (bad idea, but ...).
I'm sorry that I didn't come up with a good test case/test file for the
distribution...
Thanks,
-max (Corion)
--- CPAN-old.pm 2003-10-12 13:29:31.000000000 +0200
+++ CPAN.pm 2003-10-12 13:53:05.000000000 +0200
@@ -5655,7 +5655,7 @@
$fhw->close;
return 1;
} else {
- system("$CPAN::Config->{gzip} -c $read > $write")==0;
+ system(qq{"$CPAN::Config->{gzip}" -c "$read" > "$write"})==0;
}
}
@@ -5677,7 +5677,7 @@
$fhw->close;
return 1;
} else {
- system("$CPAN::Config->{gzip} -dc $read > $write")==0;
+ system(qq{"$CPAN::Config->{gzip}" -dc "$read" > "$write"})==0;
}
}
@@ -5708,7 +5708,7 @@
CPAN->debug("err[$err]success[$success]") if $CPAN::DEBUG;
return $success;
} else {
- return system("$CPAN::Config->{gzip} -dt $read")==0;
+ return system(qq{$CPAN::Config->{gzip} -dt "$read"})==0;
}
}
@@ -5723,7 +5723,7 @@
die "Could not gzopen $file";
$ret = bless {GZ => $gz}, $class;
} else {
- my $pipe = "$CPAN::Config->{gzip} --decompress --stdout $file |";
+ my $pipe = qq{$CPAN::Config->{gzip} --decompress --stdout "$file"
|};
my $fh = FileHandle->new($pipe) or die "Could not pipe[$pipe]: $!";
binmode $fh;
$ret = bless {FH => $fh}, $class;
@@ -5807,11 +5807,11 @@
my($system);
my $is_compressed = $class->gtest($file);
if ($is_compressed) {
- $system = "$CPAN::Config->{gzip} --decompress --stdout " .
- "< $file | $CPAN::Config->{tar} xvf -";
+ $system = qq{$CPAN::Config->{gzip} --decompress --stdout } .
+ qq{< "$file" | $CPAN::Config->{tar} xvf -};
} else {
- $system = "$CPAN::Config->{tar} xvf $file";
- }
+ $system = qq{$CPAN::Config->{tar} xvf "$file"};
+ };
if (system($system) != 0) {
# people find the most curious tar binaries that cannot handle
# pipes
@@ -5824,7 +5824,7 @@
}
$file = $ungzf;
}
- $system = "$CPAN::Config->{tar} xvf $file";
+ $system = qq{"$CPAN::Config->{tar}" xvf "$file"};
$CPAN::Frontend->myprint(qq{Using Tar:$system:\n});
if (system($system)==0) {
$CPAN::Frontend->myprint(qq{Untarred $file
successfully\n});