From: David Golden Date: Mon, 21 Dec 2009 03:38:26 +0000 (-0500) Subject: hotfix CPAN.pm to force only ftp URLs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0100440d3c83cbbd0295cecf65f71318c7bebf25;p=p5sagit%2Fp5-mst-13.2.git 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. --- diff --git a/cpan/CPAN/lib/CPAN/FirstTime.pm b/cpan/CPAN/lib/CPAN/FirstTime.pm index cf6dbb8..d1db0cd 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 2a2de35..1a3402e 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 {