Subject: | cygwin CPAN::FTP creates 0 size tar.gz's |
Since some time and only on newer releases (5.13.x) CPAN creates 0 size
tar.gz's, (all 3 0[123]*.tar.gz), and also distributions, and the error
seems to be in CPAN::FTP::hostdleasy
Debugging into it:
eval { CPAN::Tarzip->new($l)->gunzip($aslocal) };
=> creates the local 0 sized tar.gz
Cannot gzopen /home/URBANR/.cpan/authors/id/R/RU/RURBAN/Bundle-
CPANReporter2-0.04.tar.gz: No such file or directory
Debug(FTP,FTP.pm,452,[Distribution,Distribution.pm,380,localize]):
ret[/home/URBANR/.cpan/sources/authors/id/R/RU/RURBAN/Bundle-
CPANReporter2-
0.04.tar.gz.tmp5300]aslocal[/home/URBANR/.cpan/sources/authors/id/R/RU/R
URBAN/Bundle-CPANReporter2-0.04.tar.gz]
Debug(FTP,FTP.pm,469,[Distribution,Distribution.pm,380,localize]):
level[dleasy]
Debug(FTP,FTP.pm,479,[Distribution,Distribution.pm,380,localize]):
before _add_to_statistics
Debug(FTP,FTP.pm,86,[FTP,FTP.pm,480,_add_to_statistics]):
yaml_module[YAML]
Debug(FTP,FTP.pm,481,[Distribution,Distribution.pm,380,localize]): after
_add_to_statistics
Debug(Distribution,Distribution.pm,391,[Distribution,Distribution.pm,344
,get_file_onto_local_disk]):
local_wanted[/home/URBANR/.cpan/sources/authors/id/R/RU/RURBAN/Bundle-
CPANReporter2-
0.04.tar.gz]local_file[/home/URBANR/.cpan/sources/authors/id/R/RU/RURBAN
/Bundle-CPANReporter2-0.04.tar.gz]
CPAN: Digest::SHA loaded ok (v5.48)
Debug(Distribution,Distribution.pm,402,[Distribution,Distribution.pm,346
,check_integrity]): Digest::SHA is installed, verifying
Debug(Distribution,Distribution.pm,1326,[Distribution,Distribution.pm,40
3,verifyCHECKSUM]):
lc_want[/home/URBANR/.cpan/sources/authors/id/R/RU/RURBAN/CHECKSUMS]size
[23984]
Debug(Distribution,Distribution.pm,1387,[Distribution,Distribution.pm,13
27,CHECKSUM_check_file]):
chk_file[/home/URBANR/.cpan/sources/authors/id/R/RU/RURBAN/CHECKSUMS]slo
ppy[1]
Debug(Distribution,Distribution.pm,1429,[Distribution,Distribution.pm,13
27,CHECKSUM_check_file]): Found checksum for Bundle-CPANReporter2-
0.04.tar.gz:1f89a67ff8946967fa7754e2fc4814466f226d61f6a93f1929138611278b
4501
Debug(Tarzip,Tarzip.pm,170,[Distribution,Distribution.pm,1436,TIEHANDLE]
): file[/home/URBANR/.cpan/sources/authors/id/R/RU/RURBAN/Bundle-
CPANReporter2-0.04.tar.gz]
Debug(Tarzip,Tarzip.pm,153,[Tarzip,Tarzip.pm,172,gtest]): hit an
uncompressed file
Debug(Tarzip,Tarzip.pm,156,[Tarzip,Tarzip.pm,172,gtest]):
err[0]success[0]
Debug(Tarzip,Tarzip.pm,178,[Distribution,Distribution.pm,1436,TIEHANDLE]
): via uncompressed FH
Debug(CPAN,CPAN.pm,691,[Distribution,Distribution.pm,222,all_objects]):
mgr[CPAN=HASH(0x16404b0)] class[CPAN::Module]
Debug(Shell,Shell.pm,1274,[Distribution,Distribution.pm,243,expand]):
type[Author]args[RURBAN]
Debug(Shell,Shell.pm,1299,[Shell,Shell.pm,1281,expand_by_method]):
class[CPAN::Author]regex[UNDEFINED]command[UNDEFINED]
Debug(Shell,Shell.pm,1380,[Shell,Shell.pm,1281,expand_by_method]):
class[CPAN::Author]wantarray[]count m[1]
Debug(Author,Author.pm,134,[Distribution,Distribution.pm,245,dir_listing
]): chksumfile[R/RU/RURBAN/CHECKSUMS]recursive[0]may_ftp[0]
Checksum mismatch for distribution file. Please investigate.
...
Since CPAN::FTP cannot be disabled as the other methods and does not
check for such failures this is disappointing.
I solved it with this patch:
--- CPAN/FTP.pm~ 2010-09-22 08:04:05.158926500 +0200
+++ CPAN/FTP.pm 2010-09-24 12:54:08.216372100 +0200
@@ -576,13 +576,16 @@
$ThesiteURL = $ro_url;
return $ungz;
}
- else {
+ elsif (-f $l && -r _) {
eval { CPAN::Tarzip->new($l)->gunzip($aslocal) };
- if ( -f $aslocal) {
+ if ( -f $aslocal && -s _) {
$ThesiteURL = $ro_url;
return $aslocal;
}
- else {
+ elsif (! -s $aslocal) {
+ unlink $aslocal;
+ }
+ elsif (-f $l) {
$CPAN::Frontend->mywarn("Error decompressing
'$l': $@\n")
if $@;
return;
Possible workarounds also not yet working:
* check -s 0 and fallthru then
* let CPAN::FTP be disabled via dontload_hash
'dontload_hash' => { q[Net::FTP]=>q[1], q[ftp]=>q[1], q[curl]=>q[1],
q[LWP::UserAgent]=>q[1], q[LWP]=>q[1], q[CPAN::FTP]=>q[1] },
wget works fine.
older cpan's do work fine, so I can download with 5.10 and install
manually with 5.13.x
--
Reini Urban