Branch Coverage

blib/lib/CPAN/FTP.pm
Criterion Covered Total %
branch 56 454 12.3


line true false branch
26 0 0 if exists &Errno::EAGAIN and $! == &Errno::EAGAIN
27 0 0 if ++$cnt > 100000
38 0 0 if defined $ftpstats_size and $ftpstats_size <= 0
39 0 0 $fh ? :
43 0 0 if $^O eq "MSWin32"
52 0 0 if ($sleep > 3)
59 0 0 if ($sleep <= 6) { }
67 0 0 if ($@)
68 0 0 if (ref $@) { }
69 0 0 if (ref $@ eq 'CPAN::Exception::yaml_not_installed') { }
0 0 elsif (ref $@ eq 'CPAN::Exception::yaml_process_error') { }
80 0 0 unless rename $file, $to
93 6 0 if ('CPAN'->has_inst('Time::HiRes')) { }
115 0 3 if $CPAN::DEBUG
116 0 3 if ($CPAN::META->has_inst($yaml_module))
123 0 0 if $sdebug
125 0 0 if $fh and defined fileno $fh
127 0 0 if $sdebug
128 0 0 if $sdebug
133 0 0 unless defined $ftpstats_size
136 0 0 unless $fullstats->{'history'}
145 0 0 if $sdebug
146 0 0 if $sdebug
147 0 0 if $sdebug
151 0 0 if ($sdebug)
160 0 0 if $^O eq "MSWin32" or $^O eq "os2"
161 0 0 if -e $sfile
162 0 0 unless rename "$sfile.$$", $sfile
174 0 0 unless (@stat)
180 0 0 unless chmod $stat[2], $dest
183 0 0 if $@
186 0 0 unless (chown $stat[4], $stat[5], $dest)
194 0 0 if $@
202 0 3 if ($file =~ s[/CHECKSUMS(.gz)?$][])
206 0 0 if $last->{'end'} - time > 3600
207 0 0 unless $last->{'file'}
208 0 0 unless $file eq dirname($last->{'file'})
212 0 3 if ($CPAN::Config->{'randomize_urllist'} and rand 1 < $CPAN::Config->{'randomize_urllist'}) { }
226 0 3 if $CPAN::DEBUG
229 0 3 unless (ref $CPAN::Config->{'urllist'} eq "ARRAY")
233 3 0 if defined $_
234 0 3 if $with_defaults
236 0 3 if $CPAN::DEBUG
237 0 3 if (UNIVERSAL::can($u, 'text')) { }
238 0 0 unless substr($u->{'TEXT'}, -1) eq "/"
240 3 0 unless substr($u, -1) eq "/"
250 0 0 if $CPAN::DEBUG
255 0 0 unless ($ftp)
259 0 0 unless defined $ftp
260 0 0 if $CPAN::DEBUG{'FTP'} & $CPAN::DEBUG
262 0 0 unless ($ftp->login("anonymous", $Config::Config{'cf_email'}))
267 0 0 unless ($ftp->cwd($dir))
273 0 0 if $CPAN::DEBUG
274 0 0 unless ($ftp->get($file, $target))
315 0 3 unless defined $aslocal
317 0 3 if ($CPAN::DEBUG)
323 0 3 if not defined $CPAN::FTP::connect_to_internet_ok and defined $_
326 0 3 if (not defined $ph or $ph) { }
335 0 0 if (-f $aslocal and -r _ and not $force & 1)
337 0 0 if ($size = -s $aslocal) { }
338 0 0 if $CPAN::DEBUG
342 0 0 unless unlink $aslocal
353 0 0 if $self->have_promising_aslocal($aslocal, $force)
359 0 0 if ($CPAN::META->has_usable('HTTP::Tiny') and $CPAN::META->has_usable('Net::SSLeay') and $CPAN::META->has_usable('IO::Socket::SSL') or $CPAN::Config->{'curl'} or $CPAN::Config->{'wget'}) { }
368 0 0 if $CPAN::Config->{$prx}
374 0 0 @missing_modules == 1 ? :
376 0 0 if ($CPAN::META->has_usable("HTTP::Tiny"))
380 0 0 if $CPAN::Config->{$prx}
385 0 0 if ($ret) { }
386 0 0 if $CPAN::DEBUG
387 0 0 if ($ret eq $aslocal_tempfile)
390 0 0 unless rename $aslocal_tempfile, $aslocal
408 0 0 if ($CPAN::META->has_usable('HTTP::Tiny') and $proto eq 'http' || $CPAN::META->has_usable('Net::SSLeay') && $CPAN::META->has_usable('IO::Socket::SSL')) { }
0 0 elsif ($CPAN::Config->{'curl'} or $CPAN::Config->{'wget'}) { }
424 0 0 !($url =~ /\.gz(?!\n)\Z/) ? :
427 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') { }
463 0 0 unless defined $dlprg_configured and length $dlprg_configured
465 0 0 if ($dlprg eq 'wget') { }
0 0 elsif ($dlprg eq 'curl') { }
471 0 0 if ($proxy_vars->{'http_proxy'})
484 0 0 if $CPAN::DEBUG
486 0 0 if ($wstatus == 0) { }
490 0 0 -f $aslocal ? :
506 0 3 if ($^O eq "MacOS")
510 0 0 if (length $name > 31)
530 0 3 if $self->have_promising_aslocal($aslocal, $force)
532 0 3 if (-f $aslocal)
539 0 3 if ($CPAN::META->has_usable("LWP::UserAgent"))
540 0 0 unless ($CPAN::FTP::Ua)
543 0 0 if ($@) { }
544 0 0 if $CPAN::DEBUG
549 0 0 if $var = $CPAN::Config->{'ftp_proxy'} || $ENV{'ftp_proxy'}
551 0 0 if $var = $CPAN::Config->{'http_proxy'} || $ENV{'http_proxy'}
553 0 0 if $var = $CPAN::Config->{'no_proxy'} || $ENV{'no_proxy'}
558 0 9 if $CPAN::Config->{$prx}
566 3 0 if ($force & 2) { }
571 0 0 unless (substr($ccurllist->[$b], 0, 4) eq "file") <=> (substr($ccurllist->[$a], 0, 4) eq "file")
584 0 3 if $CPAN::DEBUG
596 2 1 if ($CPAN::FTP::Themethod) { }
602 0 3 if $^O eq "MacOS"
606 0 3 exists $CPAN::Config->{'ftp_passive'} ? :
612 0 3 unless $scheme and "file" eq $scheme
615 0 3 if ($defaultsites) { }
616 0 0 unless (defined $CPAN::FTP::connect_to_internet_ok)
626 0 0 if ($answer =~ /^y/i) { }
632 0 0 if ($CPAN::FTP::connect_to_internet_ok) { }
643 3 0 $level =~ /dleasy/ ? :
647 0 3 if $CPAN::DEBUG
649 0 3 if (my $recommend = $self->_recommend_url_for($file, \@urllist))
653 0 3 if $CPAN::DEBUG
655 3 0 if ($ret) { }
656 0 3 if $CPAN::DEBUG
657 0 3 if ($ret eq $aslocal_tempfile) { }
3 0 elsif (-f $ret and $scheme eq 'file') { }
660 0 0 unless rename $aslocal_tempfile, $aslocal
673 0 3 if $CPAN::DEBUG
677 0 0 if $CPAN::Signal
680 3 0 if ($ret)
683 0 3 if $CPAN::DEBUG
685 0 3 if $CPAN::DEBUG
686 3 0 if ($ret)
690 0 0 unless ($CPAN::Signal)
693 0 0 if (@{$CPAN::Config->{'urllist'};}) { }
706 0 0 if ($maybe_restore)
718 0 0 unless -w $aslocal_dir
729 3 0 if $scheme
750 0 3 if $CPAN::DEBUG
751 3 0 if ($url =~ /^file:/)
753 3 0 if ($CPAN::META->has_inst('URI::URL')) { }
766 0 0 if not -f $l and $l =~ m[^/\w:]
769 0 3 if $CPAN::DEBUG
770 0 3 if (-f $l and -r _)
777 3 0 if ($l =~ /(.+)\.gz$/) { }
0 0 elsif (-f $l and -r _) { }
0 0 elsif (-f "$l.gz") { }
779 3 0 if (-f $ungz and -r _) { }
0 0 elsif (-f $l and -r _) { }
785 0 0 if (-f $aslocal and -s _) { }
0 0 elsif (not -s $aslocal) { }
0 0 elsif (-f $l) { }
793 0 0 if $@
807 0 0 if $CPAN::DEBUG
809 0 0 if (-f $aslocal) { }
814 0 0 if $@
821 0 0 if $CPAN::DEBUG
822 0 0 if ($CPAN::META->has_usable('LWP')) { }
0 0 elsif ($url =~ /^http:/i and $CPAN::META->has_usable('HTTP::Tiny')) { }
824 0 0 unless ($CPAN::FTP::Ua)
827 0 0 if ($@)
832 0 0 if ($res->is_success) { }
0 0 elsif (not $url =~ /\.gz(?!\n)\Z/) { }
843 0 0 if ($res->is_success)
844 0 0 if (eval { do { "CPAN::Tarzip"->new("$aslocal.gz")->gunzip($aslocal) } })
865 0 0 !($url =~ /\.gz(?!\n)\Z/) ? :
868 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') { }
900 0 0 if $CPAN::Signal
901 0 0 if ($url =~ m[^ftp://(.*?)/(.*)/(.*)])
903 0 0 if $CPAN::DEBUG
905 0 0 if ($CPAN::META->has_usable('Net::FTP')) { }
908 0 0 if $CPAN::DEBUG
910 0 0 if ("CPAN::FTP"->ftp_get($host, $dir, $getfile, $aslocal))
914 0 0 unless ($aslocal =~ /\.gz(?!\n)\Z/)
917 0 0 if ("CPAN::FTP"->ftp_get($host, $dir, "$getfile.gz", $gz) and eval { do { "CPAN::Tarzip"->new($gz)->gunzip($aslocal) } })
929 0 0 if $CPAN::DEBUG
932 0 0 if (UNIVERSAL::can($ro_url, "text") and $ro_url->{'FROM'} eq "USER")
940 0 0 if $ret
942 0 0 if $CPAN::Signal
969 0 0 if ($url =~ m[^([^:]+)://(.*?)/(.*)/(.*)]) { }
975 0 0 if $proto eq "file"
981 0 0 if $CPAN::DEBUG
988 0 0 unless defined $funkyftp
989 0 0 if $funkyftp =~ /^\s*$/
994 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') { }
997 0 0 unless $url =~ m[\Aftp://]
1004 0 0 if ($proxy_vars->{'http_proxy'})
1008 0 0 unless $url =~ m[\Aftp://]
1021 0 0 if $CPAN::DEBUG
1023 0 0 if ($f eq "lynx")
1025 0 0 if (-s $aslocal) { }
1027 0 0 unless open FH, $aslocal
1030 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#1046">1046</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#1047">1047</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#1055">1055</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#1063">1063</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#1066">1066</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#1067">1067</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#1080">1080</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#1085">1085</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#1087">1087</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#1095">1095</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#1112">1112</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#1117">1117</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#1138">1138</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#1139">1139</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#1149">1149</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#1162">1162</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#1163">1163</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#1165">1165</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#1168">1168</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#1171">1171</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#1191">1191</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#1198">1198</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#1229">1229</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#1236">1236</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#1246">1246</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#1251">1251</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#1268">1268</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#1275">1275</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#1291">1291</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#1292">1292</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#1293">1293</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#1302">1302</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if (-M _ > 182.625) { } </td> </tr> </table> </body> </html>