diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/CPAN/Tarzip.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/CPAN/Tarzip.pm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Master/tlpkg/tlperl/lib/CPAN/Tarzip.pm b/Master/tlpkg/tlperl/lib/CPAN/Tarzip.pm index 708a5794f34..f585a01bf72 100644 --- a/Master/tlpkg/tlperl/lib/CPAN/Tarzip.pm +++ b/Master/tlpkg/tlperl/lib/CPAN/Tarzip.pm @@ -4,7 +4,7 @@ use strict; use vars qw($VERSION @ISA $BUGHUNTING); use CPAN::Debug; use File::Basename qw(basename); -$VERSION = "5.5011"; +$VERSION = "5.5012"; # module is internal to CPAN.pm @ISA = qw(CPAN::Debug); ## no critic @@ -73,6 +73,7 @@ sub gzip { my $cwd = `pwd`; my $gz = Compress::Zlib::gzopen($write, "wb") or $CPAN::Frontend->mydie("Cannot gzopen $write: $! (pwd is $cwd)\n"); + binmode($fhw); $gz->gzwrite($buffer) while read($fhw,$buffer,4096) > 0 ; $gz->gzclose() ; @@ -94,8 +95,9 @@ sub gunzip { or $CPAN::Frontend->mydie("Could not open >$write: $!"); my $gz = Compress::Zlib::gzopen($read, "rb") or $CPAN::Frontend->mydie("Cannot gzopen $read: $!\n"); + binmode($fhw); $fhw->print($buffer) - while $gz->gzread($buffer) > 0 ; + while $gz->gzread($buffer) > 0 ; $CPAN::Frontend->mydie("Error reading from $read: $!\n") if $gz->gzerror != Compress::Zlib::Z_STREAM_END(); $gz->gzclose() ; @@ -103,7 +105,7 @@ sub gunzip { return 1; } else { my $command = CPAN::HandleConfig->safe_quote($self->{UNGZIPPRG}); - system(qq{$command -dc "$read" > "$write"})==0; + system(qq{$command -d -c "$read" > "$write"})==0; } } @@ -188,7 +190,7 @@ sub TIEHANDLE { $class->debug("via Compress::Zlib"); } else { my $gzip = CPAN::HandleConfig->safe_quote($self->{UNGZIPPRG}); - my $pipe = "$gzip -dc $file |"; + my $pipe = "$gzip -d -c $file |"; my $fh = FileHandle->new($pipe) or $CPAN::Frontend->mydie("Could not pipe[$pipe]: $!"); binmode $fh; $self->{FH} = $fh; @@ -322,7 +324,7 @@ Can't continue cutting file '$file'. my $tarcommand = CPAN::HandleConfig->safe_quote($exttar); if ($is_compressed) { my $command = CPAN::HandleConfig->safe_quote($extgzip); - $system = qq{$command -dc }. + $system = qq{$command -d -c }. qq{< "$file" | $tarcommand x${tar_verb}f -}; } else { $system = qq{$tarcommand x${tar_verb}f "$file"}; |