From: Michael G Schwern Date: Fri, 15 Jul 2005 02:11:29 +0000 (-0700) Subject: [perl #36514] Add curl support to CPAN.pm X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=73beb80caec743f7a0628a7df6def488c00ea59a;p=p5sagit%2Fp5-mst-13.2.git [perl #36514] Add curl support to CPAN.pm From: "Michael G Schwern via RT" Message-ID: (and bump $CPAN::FirstTime::VERSION) p4raw-id: //depot/perl@25155 --- diff --git a/lib/CPAN.pm b/lib/CPAN.pm index ebc88ba..059c4f5 100644 --- a/lib/CPAN.pm +++ b/lib/CPAN.pm @@ -2634,26 +2634,27 @@ 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 -"; + $src_switch = " -O -"; } + my($chdir) = ""; my($stdout_redir) = " > $asl_ungz"; if ($f eq "ncftpget"){ @@ -2729,7 +2730,7 @@ returned status $estatus (wstat $wstatus)$size }); } return if $CPAN::Signal; - } # wget,lynx,ncftpget,ncftp + } # transfer programs } # host } diff --git a/lib/CPAN/FirstTime.pm b/lib/CPAN/FirstTime.pm index 5f9107f..35043d7 100644 --- a/lib/CPAN/FirstTime.pm +++ b/lib/CPAN/FirstTime.pm @@ -18,7 +18,7 @@ use File::Basename (); use File::Path (); use File::Spec; use vars qw($VERSION); -$VERSION = substr q$Revision: 1.60 $, 10; +$VERSION = substr q$Revision: 1.60_01 $, 10; =head1 NAME @@ -289,7 +289,10 @@ by ENTER. my(@path) = split /$Config{'path_sep'}/, $ENV{'PATH'}; local $^W = $old_warn; my $progname; - for $progname (qw/gzip tar unzip make lynx wget ncftpget ncftp ftp gpg/){ + for $progname (qw/gzip tar unzip make + curl lynx wget ncftpget ncftp ftp + gpg/) + { if ($^O eq 'MacOS') { $CPAN::Config->{$progname} = 'not_here'; next;