Branch Coverage

blib/lib/CPAN/FTP.pm
Criterion Covered Total %
branch 54 396 13.6


line true false branch
26 0 0 if $! == 11
27 0 0 if ++$cnt > 100000
37 0 0 $fh ? :
41 0 0 if $^O eq 'MSWin32'
50 0 0 if ($sleep > 3)
57 0 0 if ($sleep <= 6) { }
65 0 0 if ($@)
66 0 0 if (ref $@) { }
67 0 0 if (ref $@ eq 'CPAN::Exception::yaml_not_installed') { }
0 0 elsif (ref $@ eq 'CPAN::Exception::yaml_process_error') { }
78 0 0 unless rename $file, $to
91 6 0 if ('CPAN'->has_inst('Time::HiRes')) { }
113 0 3 if $CPAN::DEBUG
114 0 3 if ($CPAN::META->has_inst($yaml_module))
121 0 0 if $sdebug
125 0 0 if $sdebug
126 0 0 if $sdebug
138 0 0 if $sdebug
139 0 0 if $sdebug
140 0 0 if $sdebug
144 0 0 if ($sdebug)
153 0 0 if $^O eq 'MSWin32' or $^O eq 'os2'
154 0 0 if -e $sfile
155 0 0 unless rename "$sfile.$$", $sfile
167 0 0 unless (@stat)
173 0 0 unless chmod $stat[2], $dest
176 0 0 if $@
179 0 0 unless (chown $stat[4], $stat[5], $dest)
187 0 0 if $@
195 0 3 if ($file =~ s[/CHECKSUMS(.gz)?$][])
199 0 0 if $last->{'end'} - time > 3600
200 0 0 unless $last->{'file'}
201 0 0 unless $file eq dirname($last->{'file'})
205 0 3 if ($CPAN::Config->{'randomize_urllist'} and rand 1 < $CPAN::Config->{'randomize_urllist'}) { }
219 0 3 if $CPAN::DEBUG
222 0 3 unless (ref $CPAN::Config->{'urllist'} eq 'ARRAY')
226 3 0 if defined $_
227 0 3 if $with_defaults
229 0 3 if $CPAN::DEBUG
230 0 3 if (UNIVERSAL::can($u, 'text')) { }
231 0 0 unless substr($u->{'TEXT'}, -1) eq '/'
233 3 0 unless substr($u, -1) eq '/'
243 0 0 if $CPAN::DEBUG
248 0 0 unless ($ftp)
252 0 0 unless defined $ftp
253 0 0 if $CPAN::DEBUG{'FTP'} & $CPAN::DEBUG
255 0 0 unless ($ftp->login('anonymous', $Config::Config{'cf_email'}))
260 0 0 unless ($ftp->cwd($dir))
266 0 0 if $CPAN::DEBUG
267 0 0 unless ($ftp->get($file, $target))
308 0 3 unless defined $aslocal
310 0 3 if ($CPAN::DEBUG)
315 0 3 if ($^O eq 'MacOS')
319 0 0 if (length $name > 31)
339 0 0 if (-f $aslocal and -r _ and not $force & 1)
341 0 0 if ($size = -s $aslocal) { }
342 0 0 if $CPAN::DEBUG
346 0 0 unless unlink $aslocal
352 0 3 if (-f $aslocal)
359 0 3 if ($CPAN::META->has_usable('LWP::UserAgent'))
360 0 0 unless ($CPAN::FTP::Ua)
363 0 0 if ($@) { }
364 0 0 if $CPAN::DEBUG
369 0 0 if $var = $CPAN::Config->{'ftp_proxy'} || $ENV{'ftp_proxy'}
371 0 0 if $var = $CPAN::Config->{'http_proxy'} || $ENV{'http_proxy'}
373 0 0 if $var = $CPAN::Config->{'no_proxy'} || $ENV{'no_proxy'}
378 0 9 if $CPAN::Config->{$prx}
386 3 0 if ($force & 2) { }
391 0 0 unless (substr($ccurllist->[$b], 0, 4) eq 'file') <=> (substr($ccurllist->[$a], 0, 4) eq 'file')
404 0 3 if $CPAN::DEBUG
416 2 1 if ($CPAN::FTP::Themethod) { }
422 0 3 if $^O eq 'MacOS'
426 0 3 exists $CPAN::Config->{'ftp_passive'} ? :
430 0 3 if not defined $CPAN::FTP::connect_to_internet_ok and defined $_
435 0 3 unless $scheme and 'file' eq $scheme
438 0 3 if ($defaultsites) { }
439 0 0 unless (defined $CPAN::FTP::connect_to_internet_ok)
449 0 0 if ($answer =~ /^y/i) { }
455 0 0 if ($CPAN::FTP::connect_to_internet_ok) { }
466 3 0 $level =~ /dleasy/ ? :
470 0 3 if $CPAN::DEBUG
472 0 3 if (my $recommend = $self->_recommend_url_for($file, \@urllist))
476 0 3 if $CPAN::DEBUG
478 3 0 if ($ret) { }
479 0 3 if $CPAN::DEBUG
480 0 3 if ($ret eq $aslocal_tempfile) { }
3 0 elsif (-f $ret and $scheme eq 'file') { }
483 0 0 unless rename $aslocal_tempfile, $aslocal
496 0 3 if $CPAN::DEBUG
500 0 0 if $CPAN::Signal
503 3 0 if ($ret)
506 0 3 if $CPAN::DEBUG
508 0 3 if $CPAN::DEBUG
509 3 0 if ($ret)
513 0 0 unless ($CPAN::Signal)
516 0 0 if (@{$CPAN::Config->{'urllist'};}) { }
529 0 0 if ($maybe_restore)
541 0 0 unless -w $aslocal_dir
552 3 0 if $scheme
573 0 3 if $CPAN::DEBUG
574 3 0 if ($url =~ /^file:/)
576 3 0 if ($CPAN::META->has_inst('URI::URL')) { }
589 0 0 if not -f $l and $l =~ m[^/\w:]
592 0 3 if $CPAN::DEBUG
593 0 3 if (-f $l and -r _)
600 3 0 if ($l =~ /(.+)\.gz$/) { }
0 0 elsif (-f $l and -r _) { }
0 0 elsif (-f "$l.gz") { }
602 3 0 if (-f $ungz and -r _) { }
0 0 elsif (-f $l and -r _) { }
608 0 0 if (-f $aslocal and -s _) { }
0 0 elsif (not -s $aslocal) { }
0 0 elsif (-f $l) { }
616 0 0 if $@
630 0 0 if $CPAN::DEBUG
632 0 0 if (-f $aslocal) { }
637 0 0 if $@
644 0 0 if $CPAN::DEBUG
645 0 0 if ($CPAN::META->has_usable('LWP')) { }
0 0 elsif ($url =~ /^http:/i and $CPAN::META->has_usable('HTTP::Tiny')) { }
647 0 0 unless ($CPAN::FTP::Ua)
650 0 0 if ($@)
655 0 0 if ($res->is_success) { }
0 0 elsif (not $url =~ /\.gz(?!\n)\Z/) { }
666 0 0 if ($res->is_success)
667 0 0 if (eval { do { 'CPAN::Tarzip'->new("$aslocal.gz")->gunzip($aslocal) } })
688 0 0 !($url =~ /\.gz(?!\n)\Z/) ? :
691 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') { }
723 0 0 if $CPAN::Signal
724 0 0 if ($url =~ m[^ftp://(.*?)/(.*)/(.*)])
726 0 0 if $CPAN::DEBUG
728 0 0 if ($CPAN::META->has_usable('Net::FTP')) { }
731 0 0 if $CPAN::DEBUG
733 0 0 if ('CPAN::FTP'->ftp_get($host, $dir, $getfile, $aslocal))
737 0 0 unless ($aslocal =~ /\.gz(?!\n)\Z/)
740 0 0 if ('CPAN::FTP'->ftp_get($host, $dir, "$getfile.gz", $gz) and eval { do { 'CPAN::Tarzip'->new($gz)->gunzip($aslocal) } })
752 0 0 if $CPAN::DEBUG
755 0 0 if (UNIVERSAL::can($ro_url, 'text') and $ro_url->{'FROM'} eq 'USER')
763 0 0 if $ret
765 0 0 if $CPAN::Signal
792 0 0 if ($url =~ m[^([^:]+)://(.*?)/(.*)/(.*)]) { }
798 0 0 if $proto eq 'file'
804 0 0 if $CPAN::DEBUG
811 0 0 unless defined $funkyftp
812 0 0 if $funkyftp =~ /^\s*$/
817 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') { }
820 0 0 unless $url =~ m[\Aftp://]
827 0 0 if ($proxy_vars->{'http_proxy'})
831 0 0 unless $url =~ m[\Aftp://]
844 0 0 if $CPAN::DEBUG
846 0 0 if ($f eq 'lynx')
848 0 0 if (-s $aslocal) { }
850 0 0 unless open FH, $aslocal
853 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#869">869</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#870">870</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#878">878</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#886">886</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#889">889</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#890">890</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#903">903</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#908">908</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#910">910</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#918">918</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#935">935</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#940">940</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#961">961</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#962">962</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#972">972</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#985">985</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#986">986</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#988">988</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#991">991</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#994">994</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#1014">1014</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#1021">1021</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#1052">1052</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#1059">1059</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#1069">1069</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#1074">1074</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#1091">1091</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#1098">1098</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#1114">1114</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#1115">1115</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#1116">1116</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#1125">1125</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if (-M _ > 182.625) { } </td> </tr> </table> </body> </html>