Skip Menu |
 

This queue is for tickets about the Net-FTPServer CPAN distribution.

Report information
The Basics
Id: 35698
Status: resolved
Priority: 0/
Queue: Net-FTPServer

People
Owner: ryochin [...] cpan.org
Requestors: steve [...] silug.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.122
Fixed in: (no value)



Subject: t/350generatorzip test failure
Download (untitled) / with headers
text/plain 431b
On Fedora 8 (perl 5.8.8), t/350generatorzip gives a long error that starts with the following line: error: Tried to add member with zero or undef value for time It then finishes the test, apparently successfully. On Fedora 9 (perl 5.10.0), the same test fails. The error it gives starts with this line: Not a CODE reference at /builddir/build/BUILD/Net-FTPServer-1.122/blib/lib/Net/FTPServer.pm line 8112, <STDIN> line 32.
Subject: f8-build.log
Download f8-build.log
application/octet-stream 48.9k

Message body not shown because it is not plain text.

Subject: f9-build.log
Download f9-build.log
application/octet-stream 26.2k

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 166b
I think the solution to this may be simply to replace "&{$ {Archive::Zip::}{COMPRESSION_STORED}}" and things like that with simply "Archive::Zip::COMPRESSION_STORED".
Download (untitled) / with headers
text/plain 633b
Sorry for all the emails, but I've made a little more progress... On Wed May 07 16:17:10 2008, STEVE wrote: Show quoted text
> I think the solution to this may be simply to replace "&{$ > {Archive::Zip::}{COMPRESSION_STORED}}" and things like that with simply > "Archive::Zip::COMPRESSION_STORED".
Actually, using &Archive::Zip::... gets around the 'Bareword ... not allowed while "strict subs" in use' error. That makes the test succeed on Fedora 9, but with essentially the same warnings it has on Fedora 8. Here's a quick fix for that problem: perl -pi -e 's/(\&)\s*{\s*\$\s*{\s*([\w:]+)\s*}\s*{\s*(\w+)\s*}\s*}/\1\2\3/' lib/Net/FTPServer.pm
Download (untitled) / with headers
text/plain 218b
Show quoted text
> perl -pi -e > 's/(\&)\s*{\s*\$\s*{\s*([\w:]+)\s*}\s*{\s*(\w+)\s*}\s*}/\1\2\3/' > lib/Net/FTPServer.pm
Here is a patch for that. Note that I have added an "if $time" to avoid another error message during the test.
Download Net::FTPServer.diff
text/x-diff 3.6k
--- lib/Net/FTPServer.pm.orig Fri Jul 15 12:10:22 2005 +++ lib/Net/FTPServer.pm Thu Aug 27 17:13:15 2009 @@ -4228,7 +4228,7 @@ sub _archive_generator_zip $zip->addMember ($memb); $memb->desiredCompressionMethod - (&{$ {Archive::Zip::}{COMPRESSION_DEFLATED}}); + (&Archive::Zip::COMPRESSION_DEFLATED); $memb->desiredCompressionLevel (9); } }, @@ -4260,7 +4260,7 @@ sub _archive_generator_zip if ($file) { unlink $tmpname; - $zip->writeToFileHandle ($file, 1) == &{$ {Archive::Zip::}{AZ_OK}} + $zip->writeToFileHandle ($file, 1) == &Archive::Zip::AZ_OK or die "failed to write to zip file: $!"; $file->seek (0, 0); } @@ -4269,7 +4269,7 @@ sub _archive_generator_zip unless ($file) { $file = new IO::Scalar; - $zip->writeToFileHandle ($file, 1) == &{$ {Archive::Zip::}{AZ_OK}} + $zip->writeToFileHandle ($file, 1) == &Archive::Zip::AZ_OK or die "failed to write to zip file: $!"; $file->seek (0, 0); } @@ -8109,16 +8109,16 @@ sub _newFromFileHandle $self->fileName ($filename); $self->{externalFileName} = $filename; - $self->{compressionMethod} = &{$ {Archive::Zip::}{COMPRESSION_STORED}}; + $self->{compressionMethod} = &Archive::Zip::COMPRESSION_STORED; my ($mode, $perms, $nlink, $user, $group, $size, $time) = $fileh->status; $self->{compressedSize} = $self->{uncompressedSize} = $size; $self->desiredCompressionMethod ($self->compressedSize > 0 - ? &{$ {Archive::Zip::}{COMPRESSION_DEFLATED}} - : &{$ {Archive::Zip::}{COMPRESSION_STORED}}); + ? &Archive::Zip::COMPRESSION_DEFLATED + : &Archive::Zip::COMPRESSION_STORED); $self->unixFileAttributes ($perms); - $self->setLastModFileDateTimeFromUnix ($time); + $self->setLastModFileDateTimeFromUnix ($time) if $time; $self->isTextFile (0); $self; @@ -8136,7 +8136,7 @@ sub fh return $self->{fh} if $self->{fh}; $self->{fh} = $self->{fileh}->open ("r") - or return &{$ {Archive::Zip::}{AZ_IO_ERROR}}; + or return &Archive::Zip::AZ_IO_ERROR; $self->{fh}; } @@ -8146,17 +8146,17 @@ sub rewindData my $self = shift; my $status = $self->SUPER::rewindData (@_); - return $status if $status != &{$ {Archive::Zip::}{AZ_OK}}; + return $status if $status != &Archive::Zip::AZ_OK; - return &{$ {Archive::Zip::}{AZ_IO_ERROR}} unless $self->fh; + return &Archive::Zip::AZ_IO_ERROR unless $self->fh; # Not all personalities can seek backwards in the stream. Close # the file and reopen it instead. - $self->endRead == &{$ {Archive::Zip::}{AZ_OK}} - or return &{$ {Archive::Zip::}{AZ_IO_ERROR}}; + $self->endRead == &Archive::Zip::AZ_OK + or return &Archive::Zip::AZ_IO_ERROR; $self->fh; - return &{$ {Archive::Zip::}{AZ_OK}}; + return &Archive::Zip::AZ_OK; } sub _readRawChunk @@ -8165,12 +8165,12 @@ sub _readRawChunk my $dataref = shift; my $chunksize = shift; - return (0, &{$ {Archive::Zip::}{AZ_OK}}) unless $chunksize; + return (0, &Archive::Zip::AZ_OK) unless $chunksize; my $bytesread = $self->fh->sysread ($$dataref, $chunksize) - or return (0, &{$ {Archive::Zip::}{AZ_IO_ERROR}}); + or return (0, &Archive::Zip::AZ_IO_ERROR); - return ($bytesread, &{$ {Archive::Zip::}{AZ_OK}}); + return ($bytesread, &Archive::Zip::AZ_OK); } sub endRead @@ -8180,10 +8180,10 @@ sub endRead if ($self->{fh}) { $self->{fh}->close - or return &{$ {Archive::Zip::}{AZ_IO_ERROR}}; + or return &Archive::Zip::AZ_IO_ERROR; delete $self->{fh}; } - return &{$ {Archive::Zip::}{AZ_OK}}; + return &Archive::Zip::AZ_OK; } 1 # So that the require or use succeeds.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.