summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael G Schwern <schwern@pobox.com>2005-07-14 19:11:29 -0700
committerSteve Hay <SteveHay@planit.com>2005-07-15 15:50:38 +0000
commit73beb80caec743f7a0628a7df6def488c00ea59a (patch)
tree51eb2fcf35fcddd7a147f9314cf9c310b90626af /lib
parent840378f54dd758264f790e82d48dc9ba0f3485f3 (diff)
downloadperl-73beb80caec743f7a0628a7df6def488c00ea59a.tar.gz
[perl #36514] Add curl support to CPAN.pm
From: "Michael G Schwern via RT" <perlbug-followup@perl.org> Message-ID: <rt-3.0.11-36514-117446.9.35668319684652@perl.org> (and bump $CPAN::FirstTime::VERSION) p4raw-id: //depot/perl@25155
Diffstat (limited to 'lib')
-rw-r--r--lib/CPAN.pm21
-rw-r--r--lib/CPAN/FirstTime.pm7
2 files changed, 16 insertions, 12 deletions
diff --git a/lib/CPAN.pm b/lib/CPAN.pm
index ebc88ba3fa..059c4f569c 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 5f9107faf1..35043d7b30 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;