I did a little digging. The problem only occurs of Compress::Zlib is not
installed. I noticed that I didn't get this error on another system
(Linux - Ubuntu 7.10 with Perl v5.8.8), and I've figured out why.
The errors are getting generated from the gtest method in
blib/lib/CPAN/Tarzip.pm:
111 sub gtest {
112 my($self) = @_;
113 return $self->{GTEST} if exists $self->{GTEST};
114 defined $self->{FILE} or $CPAN::Frontend->mydie("gtest called
but no FILE specified");
115 my $read = $self->{FILE};
116 my $success;
117 # After I had reread the documentation in zlib.h, I discovered that
118 # uncompressed files do not lead to an gzerror (anymore?).
119 if ( $CPAN::META->has_inst("Compress::Zlib") ) {
120 my($buffer,$len);
121 $len = 0;
122 my $gz = Compress::Zlib::gzopen($read, "rb")
123 or $CPAN::Frontend->mydie(sprintf("Cannot gzopen %s: %s\n",
124 $read,
125
$Compress::Zlib::gzerrno));
126 while ($gz->gzread($buffer) > 0 ) {
127 $len += length($buffer);
128 $buffer = "";
129 }
130 my $err = $gz->gzerror;
131 $success = ! $err || $err == Compress::Zlib::Z_STREAM_END();
132 if ($len == -s $read) {
133 $success = 0;
134 CPAN->debug("hit an uncompressed file") if $CPAN::DEBUG;
135 }
136 $gz->gzclose();
137 CPAN->debug("err[$err]success[$success]") if $CPAN::DEBUG;
138 } else {
139 my $command =
CPAN::HandleConfig->safe_quote($self->{UNGZIPPRG});
140 $success = 0==system(qq{$command -qdt "$read"});
141 }
142 return $self->{GTEST} = $success;
143 }
On the Linux system, where it works, Compress::Zlib is installed, so the
first clause of the if statement at line 119 is taken. On the Solaris
system, where I get the errors, the else clause is taken. If I force
the Linux system to take the else clause, too ( "if (0 &&
$CPAN::META->has_inst("Compress::Zlib")..." then the Linux system also
displays the error.
... I just installed Compress::Zlib on the Solaris box, and the problem
has gone away.