Branch Coverage

blib/lib/CPAN/FTP.pm
Criterion Covered Total %
branch 60 396 15.1


line true false branch
23 0 0 $fh ? :
27 0 0 if $^O eq 'MSWin32'
32 0 0 unless open $fh, "+>>$file"
37 0 0 if ($sleep > 3)
41 0 0 if ($sleep <= 3) { }
0 0 elsif ($sleep <= 6) { }
48 0 0 if ($@)
49 0 0 if (ref $@) { }
50 0 0 if (ref $@ eq 'CPAN::Exception::yaml_not_installed') { }
0 0 elsif (ref $@ eq 'CPAN::Exception::yaml_process_error') { }
58 0 0 unless rename $file, $to
71 6 0 if ('CPAN'->has_inst('Time::HiRes')) { }
93 0 3 if $CPAN::DEBUG
94 0 3 if ($CPAN::META->has_inst($yaml_module))
101 0 0 if $sdebug
105 0 0 if $sdebug
106 0 0 if $sdebug
118 0 0 if $sdebug
119 0 0 if $sdebug
120 0 0 if $sdebug
124 0 0 if ($sdebug)
133 0 0 if $^O eq 'MSWin32' or $^O eq 'os2'
134 0 0 if -e $sfile
135 0 0 unless rename "$sfile.$$", $sfile
147 0 0 unless (@stat)
153 0 0 unless chmod $stat[2], $dest
156 0 0 if $@
159 0 0 unless (chown $stat[4], $stat[5], $dest)
167 0 0 if $@
175 0 3 if ($file =~ s[/CHECKSUMS(.gz)?$][])
179 0 0 if $$last{'end'} - time > 3600
180 0 0 unless $$last{'file'}
181 0 0 unless $file eq dirname($$last{'file'})
185 0 3 if ($$CPAN::Config{'randomize_urllist'} and rand 1 < $$CPAN::Config{'randomize_urllist'}) { }
199 0 3 if $CPAN::DEBUG
202 0 3 unless (ref $$CPAN::Config{'urllist'} eq 'ARRAY')
206 3 0 if defined $_
207 0 3 if $with_defaults
209 0 3 if $CPAN::DEBUG
210 0 3 if (UNIVERSAL::can($u, 'text')) { }
211 0 0 unless substr($$u{'TEXT'}, -1) eq '/'
213 3 0 unless substr($u, -1) eq '/'
223 0 0 if $CPAN::DEBUG
228 0 0 unless ($ftp)
232 0 0 unless defined $ftp
233 0 0 if $CPAN::DEBUG{'FTP'} & $CPAN::DEBUG
235 0 0 unless ($ftp->login('anonymous', $Config::Config{'cf_email'}))
240 0 0 unless ($ftp->cwd($dir))
246 0 0 if $CPAN::DEBUG
247 0 0 unless ($ftp->get($file, $target))
288 0 3 unless defined $aslocal
290 0 3 if ($CPAN::DEBUG)
295 0 3 if ($^O eq 'MacOS')
299 0 0 if (length $name > 31)
319 0 0 if (-f $aslocal and -r _ and not $force & 1)
321 0 0 if ($size = -s $aslocal) { }
322 0 0 if $CPAN::DEBUG
326 0 0 unless unlink $aslocal
332 0 3 if (-f $aslocal)
339 3 0 if ($CPAN::META->has_usable('LWP::UserAgent'))
340 1 2 unless ($CPAN::FTP::Ua)
343 0 1 if ($@) { }
344 0 0 if $CPAN::DEBUG
348 0 1 if $var = $$CPAN::Config{'ftp_proxy'} || $ENV{'ftp_proxy'}
350 0 1 if $var = $$CPAN::Config{'http_proxy'} || $ENV{'http_proxy'}
352 0 1 if $var = $$CPAN::Config{'no_proxy'} || $ENV{'no_proxy'}
358 0 9 if $$CPAN::Config{$prx}
366 3 0 if ($force & 2) { }
369 0 0 unless (substr($$ccurllist[$b], 0, 4) eq 'file') <=> (substr($$ccurllist[$a], 0, 4) eq 'file')
384 0 3 if $CPAN::DEBUG
396 2 1 if ($CPAN::FTP::Themethod) { }
402 0 3 if $^O eq 'MacOS'
404 0 3 exists $$CPAN::Config{'ftp_passive'} ? :
410 0 3 if not defined $CPAN::FTP::connect_to_internet_ok and defined $_
415 0 3 unless $scheme and 'file' eq $scheme
418 0 3 if ($defaultsites) { }
419 0 0 unless (defined $CPAN::FTP::connect_to_internet_ok)
429 0 0 if ($answer =~ /^y/i) { }
435 0 0 if ($CPAN::FTP::connect_to_internet_ok) { }
446 3 0 $level =~ /dleasy/ ? :
450 0 3 if $CPAN::DEBUG
452 0 3 if (my $recommend = $self->_recommend_url_for($file, \@urllist))
456 0 3 if $CPAN::DEBUG
458 3 0 if ($ret) { }
459 0 3 if $CPAN::DEBUG
460 0 3 if ($ret eq $aslocal_tempfile) { }
3 0 elsif (-f $ret and $scheme eq 'file') { }
463 0 0 unless rename $aslocal_tempfile, $aslocal
476 0 3 if $CPAN::DEBUG
480 0 0 if $CPAN::Signal
483 3 0 if ($ret)
486 0 3 if $CPAN::DEBUG
488 0 3 if $CPAN::DEBUG
489 3 0 if ($ret)
493 0 0 unless ($CPAN::Signal)
496 0 0 if (@{$$CPAN::Config{'urllist'};}) { }
509 0 0 if ($maybe_restore)
521 0 0 unless -w $aslocal_dir
532 3 0 if $scheme
553 0 3 if $CPAN::DEBUG
554 3 0 if ($url =~ /^file:/)
556 3 0 if ($CPAN::META->has_inst('URI::URL')) { }
569 0 0 if not -f $l and $l =~ m[^/\w:]
572 0 3 if $CPAN::DEBUG
573 0 3 if (-f $l and -r _)
580 3 0 if ($l =~ /(.+)\.gz$/) { }
0 0 elsif (-f $l and -r _) { }
0 0 elsif (-f "$l.gz") { }
582 3 0 if (-f $ungz and -r _) { }
0 0 elsif (-f $l and -r _) { }
588 0 0 if (-f $aslocal and -s _) { }
0 0 elsif (not -s $aslocal) { }
0 0 elsif (-f $l) { }
596 0 0 if $@
610 0 0 if $CPAN::DEBUG
612 0 0 if (-f $aslocal) { }
617 0 0 if $@
624 0 0 if $CPAN::DEBUG
625 0 0 if ($CPAN::META->has_usable('LWP')) { }
0 0 elsif ($url =~ /^http:/ and $CPAN::META->has_usable('HTTP::Tiny')) { }
627 0 0 unless ($CPAN::FTP::Ua)
630 0 0 if ($@)
635 0 0 if ($res->is_success) { }
0 0 elsif (not $url =~ /\.gz(?!\n)\Z/) { }
646 0 0 if ($res->is_success)
647 0 0 if (eval { do { 'CPAN::Tarzip'->new("$aslocal.gz")->gunzip($aslocal) } })
668 0 0 !($url =~ /\.gz(?!\n)\Z/) ? :
671 0 0 if ($res and $$res{'success'}) { }
0 0 elsif ($res and $$res{'status'} ne '599') { }
0 0 elsif ($res and $$res{'status'} eq '599') { }
703 0 0 if $CPAN::Signal
704 0 0 if ($url =~ m[^ftp://(.*?)/(.*)/(.*)])
706 0 0 if $CPAN::DEBUG
708 0 0 if ($CPAN::META->has_usable('Net::FTP')) { }
711 0 0 if $CPAN::DEBUG
713 0 0 if ('CPAN::FTP'->ftp_get($host, $dir, $getfile, $aslocal))
717 0 0 unless ($aslocal =~ /\.gz(?!\n)\Z/)
720 0 0 if ('CPAN::FTP'->ftp_get($host, $dir, "$getfile.gz", $gz) and eval { do { 'CPAN::Tarzip'->new($gz)->gunzip($aslocal) } })
732 0 0 if $CPAN::DEBUG
735 0 0 if (UNIVERSAL::can($ro_url, 'text') and $$ro_url{'FROM'} eq 'USER')
743 0 0 if $ret
745 0 0 if $CPAN::Signal
772 0 0 if ($url =~ m[^([^:]+)://(.*?)/(.*)/(.*)]) { }
778 0 0 if $proto eq 'file'
784 0 0 if $CPAN::DEBUG
791 0 0 unless defined $funkyftp
792 0 0 if $funkyftp =~ /^\s*$/
797 0 0 if ($f eq 'lynx') { }
0 0 elsif ($f eq 'ncftp') { }
0 0 elsif ($f eq 'wget') { }
0 0 elsif ($f eq 'curl') { }
0 0 elsif ($f eq 'ncftpget') { }
800 0 0 unless $url =~ m[\Aftp://]
807 0 0 if ($$proxy_vars{'http_proxy'})
811 0 0 unless $url =~ m[\Aftp://]
824 0 0 if $CPAN::DEBUG
826 0 0 if ($f eq 'lynx')
828 0 0 if (-s $aslocal) { }
830 0 0 unless open FH, $aslocal
833 0 0 if ($content =~ /^<.*([45]|Error [45])/is) </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#849">849</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if ($wstatus == 0) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#850">850</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if (-s $aslocal) </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#858">858</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> -f $aslocal ? : </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#866">866</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if $CPAN::Signal </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#869">869</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> unless $any_attempt </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#870">870</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if ($some_dl_success) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#883">883</a> </td> <td class="c3"> 2 </td> <td class="c0"> 0 </td> <td class="s"> if ($http_proxy) </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#888">888</a> </td> <td class="c3"> 2 </td> <td class="c0"> 0 </td> <td class="s"> if ($host) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#890">890</a> </td> <td class="c3"> 1 </td> <td class="c3"> 1 </td> <td class="s"> if ($host =~ /\Q$domain\E$/) </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#898">898</a> </td> <td class="c3"> 1 </td> <td class="c3"> 1 </td> <td class="s"> if ($want_proxy) </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#915">915</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> unless @$host_seq </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#920">920</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> unless ($ftpbin and length $ftpbin and 'MM'->maybe_command($ftpbin)) </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#941">941</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if $CPAN::DEBUG </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#942">942</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> unless ($url =~ m[^ftp://(.*?)/(.*)/(.*)]) </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#952">952</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> $CPAN::DEBUG{'FTP'} & $CPAN::DEBUG ? : </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#965">965</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if (not $netrcfile) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#"></a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> elsif ($netrc->hasdefault or $netrc->contains($host)) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#966">966</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if $CPAN::DEBUG </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#968">968</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if $CPAN::DEBUG </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#971">971</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if ($netrc->protected) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#974">974</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if ($netrc->contains($host)) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#994">994</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if ($mtime > $timestamp) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1001">1001</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if $CPAN::Signal </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1032">1032</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if ($mtime > $timestamp) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1039">1039</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if $CPAN::Signal </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1049">1049</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> unless $fh->open("|$command") </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1054">1054</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if $wstatus </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1071">1071</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if ($blocks) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1078">1078</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if (-f _) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#"></a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> elsif (-d _) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#"></a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> elsif (-c _) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#"></a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> elsif (-b _) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#"></a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> elsif (-p _) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#"></a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> elsif (-S _) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1094">1094</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if -u _ </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1095">1095</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if -g _ </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1096">1096</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if -k _ </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1105">1105</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if (-M _ > 182.625) { } </td> </tr> </table> </body> </html>