Branch Coverage

blib/lib/CPAN/FTP.pm
Criterion Covered Total %
branch 60 398 15.0


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)
44 0 0 if ($sleep <= 3) { }
0 0 elsif ($sleep <= 6) { }
50 0 0 unless open $fh, "+>>$file"
54 0 0 if ($@)
55 0 0 if (ref $@) { }
56 0 0 if (ref $@ eq 'CPAN::Exception::yaml_not_installed') { }
0 0 elsif (ref $@ eq 'CPAN::Exception::yaml_process_error') { }
64 0 0 unless rename $file, $to
77 6 0 if ('CPAN'->has_inst('Time::HiRes')) { }
99 0 3 if $CPAN::DEBUG
100 0 3 if ($CPAN::META->has_inst($yaml_module))
107 0 0 if $sdebug
111 0 0 if $sdebug
112 0 0 if $sdebug
124 0 0 if $sdebug
125 0 0 if $sdebug
126 0 0 if $sdebug
130 0 0 if ($sdebug)
139 0 0 if $^O eq 'MSWin32' or $^O eq 'os2'
140 0 0 if -e $sfile
141 0 0 unless rename "$sfile.$$", $sfile
153 0 0 unless (@stat)
159 0 0 unless chmod $stat[2], $dest
162 0 0 if $@
165 0 0 unless (chown $stat[4], $stat[5], $dest)
173 0 0 if $@
181 0 3 if ($file =~ s[/CHECKSUMS(.gz)?$][])
185 0 0 if $last->{'end'} - time > 3600
186 0 0 unless $last->{'file'}
187 0 0 unless $file eq dirname($last->{'file'})
191 0 3 if ($CPAN::Config->{'randomize_urllist'} and rand 1 < $CPAN::Config->{'randomize_urllist'}) { }
205 0 3 if $CPAN::DEBUG
208 0 3 unless (ref $CPAN::Config->{'urllist'} eq 'ARRAY')
212 3 0 if defined $_
213 0 3 if $with_defaults
215 0 3 if $CPAN::DEBUG
216 0 3 if (UNIVERSAL::can($u, 'text')) { }
217 0 0 unless substr($u->{'TEXT'}, -1) eq '/'
219 3 0 unless substr($u, -1) eq '/'
229 0 0 if $CPAN::DEBUG
234 0 0 unless ($ftp)
238 0 0 unless defined $ftp
239 0 0 if $CPAN::DEBUG{'FTP'} & $CPAN::DEBUG
241 0 0 unless ($ftp->login('anonymous', $Config::Config{'cf_email'}))
246 0 0 unless ($ftp->cwd($dir))
252 0 0 if $CPAN::DEBUG
253 0 0 unless ($ftp->get($file, $target))
294 0 3 unless defined $aslocal
296 0 3 if ($CPAN::DEBUG)
301 0 3 if ($^O eq 'MacOS')
305 0 0 if (length $name > 31)
325 0 0 if (-f $aslocal and -r _ and not $force & 1)
327 0 0 if ($size = -s $aslocal) { }
328 0 0 if $CPAN::DEBUG
332 0 0 unless unlink $aslocal
338 0 3 if (-f $aslocal)
345 3 0 if ($CPAN::META->has_usable('LWP::UserAgent'))
346 1 2 unless ($CPAN::FTP::Ua)
349 0 1 if ($@) { }
350 0 0 if $CPAN::DEBUG
355 0 1 if $var = $CPAN::Config->{'ftp_proxy'} || $ENV{'ftp_proxy'}
357 0 1 if $var = $CPAN::Config->{'http_proxy'} || $ENV{'http_proxy'}
359 0 1 if $var = $CPAN::Config->{'no_proxy'} || $ENV{'no_proxy'}
364 0 9 if $CPAN::Config->{$prx}
372 3 0 if ($force & 2) { }
377 0 0 unless (substr($ccurllist->[$b], 0, 4) eq 'file') <=> (substr($ccurllist->[$a], 0, 4) eq 'file')
390 0 3 if $CPAN::DEBUG
402 2 1 if ($CPAN::FTP::Themethod) { }
408 0 3 if $^O eq 'MacOS'
412 0 3 exists $CPAN::Config->{'ftp_passive'} ? :
416 0 3 if not defined $CPAN::FTP::connect_to_internet_ok and defined $_
421 0 3 unless $scheme and 'file' eq $scheme
424 0 3 if ($defaultsites) { }
425 0 0 unless (defined $CPAN::FTP::connect_to_internet_ok)
435 0 0 if ($answer =~ /^y/i) { }
441 0 0 if ($CPAN::FTP::connect_to_internet_ok) { }
452 3 0 $level =~ /dleasy/ ? :
456 0 3 if $CPAN::DEBUG
458 0 3 if (my $recommend = $self->_recommend_url_for($file, \@urllist))
462 0 3 if $CPAN::DEBUG
464 3 0 if ($ret) { }
465 0 3 if $CPAN::DEBUG
466 0 3 if ($ret eq $aslocal_tempfile) { }
3 0 elsif (-f $ret and $scheme eq 'file') { }
469 0 0 unless rename $aslocal_tempfile, $aslocal
482 0 3 if $CPAN::DEBUG
486 0 0 if $CPAN::Signal
489 3 0 if ($ret)
492 0 3 if $CPAN::DEBUG
494 0 3 if $CPAN::DEBUG
495 3 0 if ($ret)
499 0 0 unless ($CPAN::Signal)
502 0 0 if (@{$CPAN::Config->{'urllist'};}) { }
515 0 0 if ($maybe_restore)
527 0 0 unless -w $aslocal_dir
538 3 0 if $scheme
559 0 3 if $CPAN::DEBUG
560 3 0 if ($url =~ /^file:/)
562 3 0 if ($CPAN::META->has_inst('URI::URL')) { }
575 0 0 if not -f $l and $l =~ m[^/\w:]
578 0 3 if $CPAN::DEBUG
579 0 3 if (-f $l and -r _)
586 3 0 if ($l =~ /(.+)\.gz$/) { }
0 0 elsif (-f $l and -r _) { }
0 0 elsif (-f "$l.gz") { }
588 3 0 if (-f $ungz and -r _) { }
0 0 elsif (-f $l and -r _) { }
594 0 0 if (-f $aslocal and -s _) { }
0 0 elsif (not -s $aslocal) { }
0 0 elsif (-f $l) { }
602 0 0 if $@
616 0 0 if $CPAN::DEBUG
618 0 0 if (-f $aslocal) { }
623 0 0 if $@
630 0 0 if $CPAN::DEBUG
631 0 0 if ($CPAN::META->has_usable('LWP')) { }
0 0 elsif ($url =~ /^http:/i and $CPAN::META->has_usable('HTTP::Tiny')) { }
633 0 0 unless ($CPAN::FTP::Ua)
636 0 0 if ($@)
641 0 0 if ($res->is_success) { }
0 0 elsif (not $url =~ /\.gz(?!\n)\Z/) { }
652 0 0 if ($res->is_success)
653 0 0 if (eval { do { 'CPAN::Tarzip'->new("$aslocal.gz")->gunzip($aslocal) } })
674 0 0 !($url =~ /\.gz(?!\n)\Z/) ? :
677 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') { }
709 0 0 if $CPAN::Signal
710 0 0 if ($url =~ m[^ftp://(.*?)/(.*)/(.*)])
712 0 0 if $CPAN::DEBUG
714 0 0 if ($CPAN::META->has_usable('Net::FTP')) { }
717 0 0 if $CPAN::DEBUG
719 0 0 if ('CPAN::FTP'->ftp_get($host, $dir, $getfile, $aslocal))
723 0 0 unless ($aslocal =~ /\.gz(?!\n)\Z/)
726 0 0 if ('CPAN::FTP'->ftp_get($host, $dir, "$getfile.gz", $gz) and eval { do { 'CPAN::Tarzip'->new($gz)->gunzip($aslocal) } })
738 0 0 if $CPAN::DEBUG
741 0 0 if (UNIVERSAL::can($ro_url, 'text') and $ro_url->{'FROM'} eq 'USER')
749 0 0 if $ret
751 0 0 if $CPAN::Signal
778 0 0 if ($url =~ m[^([^:]+)://(.*?)/(.*)/(.*)]) { }
784 0 0 if $proto eq 'file'
790 0 0 if $CPAN::DEBUG
797 0 0 unless defined $funkyftp
798 0 0 if $funkyftp =~ /^\s*$/
803 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') { }
806 0 0 unless $url =~ m[\Aftp://]
813 0 0 if ($proxy_vars->{'http_proxy'})
817 0 0 unless $url =~ m[\Aftp://]
830 0 0 if $CPAN::DEBUG
832 0 0 if ($f eq 'lynx')
834 0 0 if (-s $aslocal) { }
836 0 0 unless open FH, $aslocal
839 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#855">855</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#856">856</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#864">864</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#872">872</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#875">875</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#876">876</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#889">889</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#894">894</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#896">896</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#904">904</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#921">921</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#926">926</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#947">947</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#948">948</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#958">958</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#971">971</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#972">972</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#974">974</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#977">977</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#980">980</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#1000">1000</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#1007">1007</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#1038">1038</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#1045">1045</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#1055">1055</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#1060">1060</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#1077">1077</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#1084">1084</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#1100">1100</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#1101">1101</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#1102">1102</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#1111">1111</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if (-M _ > 182.625) { } </td> </tr> </table> </body> </html>