diff options
author | David Golden <dagolden@cpan.org> | 2009-12-20 22:38:26 -0500 |
---|---|---|
committer | David Golden <dagolden@cpan.org> | 2009-12-20 22:38:26 -0500 |
commit | 0100440d3c83cbbd0295cecf65f71318c7bebf25 (patch) | |
tree | d723d6e13cdc0e53b53abe7f5110ffd0739d1686 | |
parent | 295f7fb33b9b51d201278d98cb356b6fc8c2baf3 (diff) | |
download | perl-0100440d3c83cbbd0295cecf65f71318c7bebf25.tar.gz |
hotfix CPAN.pm to force only ftp URLs
CPAN::FTP has problems with curl and other command line
programs. Having mirror autoconfig prefer http URLs was
triggering these bugs for any bootstrap installation without
LWP.
This hotfix forces only ftp URLs from autoconfig which
hides the problem for now until CPAN::FTP can be fixed
upstream.
-rw-r--r-- | cpan/CPAN/lib/CPAN/FirstTime.pm | 2 | ||||
-rw-r--r-- | cpan/CPAN/lib/CPAN/Mirrors.pm | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/cpan/CPAN/lib/CPAN/FirstTime.pm b/cpan/CPAN/lib/CPAN/FirstTime.pm index cf6dbb84fc..d1db0cdaf2 100644 --- a/cpan/CPAN/lib/CPAN/FirstTime.pm +++ b/cpan/CPAN/lib/CPAN/FirstTime.pm @@ -1627,7 +1627,7 @@ sub auto_mirrored_by { how_many => 5, callback => sub { $CPAN::Frontend->myprint(".") }, ); - my $urllist = [ map { $_->url } @best ]; + my $urllist = [ map { $_->ftp } @best ]; push @$urllist, grep { /^file:/ } @{$CPAN::Config->{urllist}}; $CPAN::Frontend->myprint(" done!\n\n"); return $urllist; diff --git a/cpan/CPAN/lib/CPAN/Mirrors.pm b/cpan/CPAN/lib/CPAN/Mirrors.pm index 2a2de35ce0..1a3402e8de 100644 --- a/cpan/CPAN/lib/CPAN/Mirrors.pm +++ b/cpan/CPAN/lib/CPAN/Mirrors.pm @@ -83,6 +83,7 @@ sub best_mirrors { my @timings; for my $m ($self->mirrors($self->countries(@$conts))) { + next unless $m->ftp; my $hostname = $m->hostname; if ( $seen->{$hostname} ) { push @timings, $seen->{$hostname} @@ -239,7 +240,7 @@ sub rsync { shift->{rsync} || '' } sub url { my $self = shift; - return $self->{http} || $self->{ftp}; + return $self->{ftp} || $self->{http}; } sub ping { |