This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
hotfix CPAN.pm to force only ftp URLs
authorDavid Golden <dagolden@cpan.org>
Mon, 21 Dec 2009 03:38:26 +0000 (22:38 -0500)
committerDavid Golden <dagolden@cpan.org>
Mon, 21 Dec 2009 03:38:26 +0000 (22:38 -0500)
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.

cpan/CPAN/lib/CPAN/FirstTime.pm
cpan/CPAN/lib/CPAN/Mirrors.pm

index cf6dbb8..d1db0cd 100644 (file)
@@ -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;
index 2a2de35..1a3402e 100644 (file)
@@ -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 {