Tweaks to get Test::Builder::Tester's tests to work in the core.
[p5sagit/p5-mst-13.2.git] / lib / CPAN.pm
index ebc88ba..fa83398 100644 (file)
@@ -252,7 +252,7 @@ use vars qw($Ua $Thesite $Themethod);
 
 package CPAN::LWP::UserAgent;
 use vars qw(@ISA $USER $PASSWD $SETUPDONE);
-# we delay requiring LWP::UserAgent and setting up inheritence until we need it
+# we delay requiring LWP::UserAgent and setting up inheritance until we need it
 
 package CPAN::Complete;
 @CPAN::Complete::ISA = qw(CPAN::Debug);
@@ -2634,26 +2634,29 @@ sub hosthard {
                                            # success above. Likely a bogus URL
 
        $self->debug("localizing funkyftpwise[$url]") if $CPAN::DEBUG;
-       my($f,$funkyftp);
-
-        # Try the most capable first (wget does HTTP, HTTPS and FTP) and
-        # leave ncftp* for last as it only does FTP.
-       for $f (qw(wget lynx ncftpget ncftp)) {
-         next unless exists $CPAN::Config->{$f};
-         $funkyftp = $CPAN::Config->{$f};
-         next unless defined $funkyftp;
+
+        # Try the most capable first and leave ncftp* for last as it only 
+        # does FTP.
+       for my $f (qw(curl wget lynx ncftpget ncftp)) {
+          my $funkyftp = $CPAN::Config->{$f};
+          next unless defined $funkyftp;
          next if $funkyftp =~ /^\s*$/;
+
          my($asl_ungz, $asl_gz);
          ($asl_ungz = $aslocal) =~ s/\.gz//;
           $asl_gz = "$asl_ungz.gz";
+
          my($src_switch) = "";
          if ($f eq "lynx"){
            $src_switch = " -source";
          } elsif ($f eq "ncftp"){
            $src_switch = " -c";
-          } elsif ($f eq "wget"){
-              $src_switch = " -O -";
+         } elsif ($f eq "wget"){
+           $src_switch = " -O -";
+         } elsif ($f eq 'curl'){
+           $src_switch = ' -L';
          }
+
          my($chdir) = "";
          my($stdout_redir) = " > $asl_ungz";
          if ($f eq "ncftpget"){
@@ -2729,7 +2732,7 @@ returned status $estatus (wstat $wstatus)$size
 });
          }
           return if $CPAN::Signal;
-       } # wget,lynx,ncftpget,ncftp
+       } # transfer programs
     } # host
 }
 
@@ -6771,7 +6774,7 @@ added to the search path of the CPAN module before the use() or
 require() statements.
 
 The configuration dialog can be started any time later again by
-issueing the command C< o conf init > in the CPAN shell.
+issuing the command C< o conf init > in the CPAN shell.
 
 Currently the following keys in the hash reference $CPAN::Config are
 defined:
@@ -6920,7 +6923,7 @@ untended.
 
 Thanks to Graham Barr for contributing the following paragraphs about
 the interaction between perl, and various firewall configurations. For
-further informations on firewalls, it is recommended to consult the
+further information on firewalls, it is recommended to consult the
 documentation that comes with the ncftp program. If you are unable to
 go through the firewall with a simple Perl setup, it is very likely
 that you can configure ncftp so that it works for your firewall.