in reply to Re^3: My interactive CPAN config doesn't understand continents.
in thread My interactive CPAN config doesn't understand continents.

The problem is it isn't even presenting a list of the continent selections to pick, whether name OR number. So when the user inputs "1","2", or "NA","North America" the script has no options to choose from and loops indefinitely. This is happening across ALL OS platforms, Perl versions, etc which started occuring a few days ago. It seems the MIRRORED.BY file being downloaded is really messed up which prevents the init script from parsing out the proper info for the question selection.
  • Comment on Re^4: My interactive CPAN config doesn't understand continents.

Replies are listed 'Best First'.
Re^5: My interactive CPAN config doesn't understand continents.
by Anonymous Monk on Jan 21, 2011 at 21:40 UTC
    PROBLEM SOLVED!!!! Ok, here is the skinny. THE MIRRORED.BY FILE FORMAT HAS SIGNIFICANTLY CHANGED. Thankfully I have a few linux boxes around that I have not yet messed with CPAN for a while that were initialized. The NEW format of MIRRORED.BY is this..
    24-7-solutions.net: frequency = "daily" dst_ftp = "ftp://mirrors.24-7-solutions.net/pub/CPAN/" dst_http = "http://mirrors.24-7-solutions.net/pub/CPAN/" dst_location = "New York, New York, United States, North America + (40.70519 -74.01136)" dst_organisation = "24/7 Solutions Ltd" dst_timezone = "-5" dst_bandwidth = "100 Mb/s" dst_contact = "24-7-solutions.net'mirror" dst_src = "ftp.funet.fi" 8086.net: frequency = "daily" dst_ftp = "ftp://ftp.mirror.8086.net/sites/CPAN/" dst_http = "http://www.mirror.8086.net/sites/CPAN/" dst_rsync = "rsync://rsync.mirror.8086.net/CPAN/" dst_location = "London, United Kingdom, Europe (51.50595 -0.1268 +9)" dst_organisation = "8086 Limited" dst_bandwidth = "100 Mb/s" dst_contact = "8086.net)support" dst_src = "ftp.funet.fi" adwired.ch: frequency = "daily" dst_ftp = "ftp://ftp.adwired.ch/CPAN/" dst_location = "Zürich, Switzerland, Europe (47.3735 8.5382)" dst_organisation = "Adwired AG" dst_timezone = "+1" dst_bandwidth = "100 Mb/s" dst_contact = "adwired.ch)daniel.kuebler" dst_src = "ftp.funet.fi"
    The OLD version of MIRRORED.BY WAS this:
    mirror.ac.za: frequency = "12 Hourly" dst_ftp = "ftp://cpan.mirror.ac.za/" dst_http = "http://cpan.mirror.ac.za/" dst_rsync = "mirror.ac.za::cpan" dst_location = "Cape Town, South Africa, Africa (33.55 18.27)" dst_organisation = "TENET" dst_timezone = "+2" dst_bandwidth = "STM-1" dst_contact = "tenet.ac.za,aa" dst_src = "rsync://www.cpan.org/CPAN/" # dst_dst = "ftp://cpan.mirror.ac.za/" # dst_contact = "mailto:tenet.ac.za,aa # dst_src = "rsync://www.cpan.org/CPAN/" is.co.za: frequency = "daily" dst_ftp = "ftp://ftp.is.co.za/pub/cpan/" dst_http = "http://mirror.is.co.za/pub/cpan/" dst_rsync = "ftp.is.co.za::IS-Mirror/ftp.cpan.org/" dst_location = "Johannesburg, Gauteng, South Africa, Africa (27. +997053 -26.143972)" dst_organisation = "Internet Solutions" dst_timezone = "+2" dst_bandwidth = "50MB" dst_contact = "is.co.za%ftpadmin" dst_src = "rsync.nic.funet.fi" dst_notes = "Limit to 4 simultaneous connections." # dst_dst = "ftp://ftp.is.co.za/pub/cpan/" # dst_contact = "mailto:is.co.za%ftpadmin # dst_src = "rsync.nic.funet.fi" saix.net: frequency = "daily" dst_ftp = "ftp://ftp.saix.net/pub/CPAN/" dst_location = "Parow, Western Cape, South Africa, Africa (-33.9 +064 18.5631)" dst_organisation = "South African Internet eXchange (SAIX)" dst_timezone = "+2" dst_bandwidth = "T3" dst_contact = "saix.net%ftp" dst_src = "ftp.funet.fi" # dst_dst = "ftp://ftp.saix.net/pub/CPAN/" # dst_contact = "mailto:saix.net%ftp # dst_src = "ftp.funet.fi"
    The code in FirstTime.pm that sets everything up for the continents is this
    sub read_mirrored_by { my $local = shift or return; my(%all,$url,$expected_size,$default,$ans,$host,$dst,$country,$con +tinent,@location); my $fh = FileHandle->new; $fh->open($local) or die "Couldn't open $local: $!"; local $/ = "\012"; while (<$fh>) { ($host) = /^([\w\.\-]+)/ unless defined $host; next unless defined $host; next unless /\s+dst_(dst|location)/; /location\s+=\s+\"([^\"]+)/ and @location = (split /\s*,\s*/, +$1) and ($continent, $country) = @location[-1,-2]; $continent =~ s/\s\(.*//; $continent =~ s/\W+$//; # if Jarkko doesn't know latitude/long +itude /dst_dst\s+=\s+\"([^\"]+)/ and $dst = $1; next unless $host && $dst && $continent && $country; $all{$continent}{$country}{$dst} = CPAN::Mirrored::By->new($co +ntinent,$country,$dst); undef $host; $dst=$continent=$country=""; } $fh->close; $CPAN::Config->{urllist} ||= []; my(@previous_urls); if (@previous_urls = @{$CPAN::Config->{urllist}}) { $CPAN::Config->{urllist} = []; } print qq{ Now we need to know where your favorite CPAN sites are located. Push a few sites onto the array (just in case the first on the array won\'t work). If you are mirroring CPAN to your local workstation, specify a file: URL. First, pick a nearby continent and country (you can pick several of each, separated by spaces, or none if you just want to keep your existing selections). Then, you will be presented with a list of URLs of CPAN mirrors in the countries you selected, along with previously selected URLs. Select some of those URLs, or just keep the old list. Finally, you will be prompted for any extra URLs -- file:, ftp:, or http: -- that host a CPAN mirror.
    Basically it dynamically builds the Continent and Country lists from this file. The ALL important fields of
    # dst_dst = "ftp://ftp.is.co.za/pub/cpan/" # dst_contact = "mailto:is.co.za%ftpadmin # dst_src = "rsync.nic.funet.fi"
    are missing from the newer MIRRORED.BY file format. So now CPAN needs to fix their newer file format to include the older data info, OR update their sub read_mirrored_by function to not look for the "dst_dst" line.

    So for now I can just use an older CPAN MIRRORED.BY file from my older boxes to get my installs running ok. Once the mirrors are configured with the FirstTime.pm init file, I (hopefully) won't have further problems with the CPAN mirrors issue.

      ( I am same as posted above) Instead of selecting "Yes" for the manual setup, select "no". CPAN will auto configure skipping the mirrors continent question. Then use CPAN to update itself.
      There's a new CPAN.pm version (v1.9402) available! [Current version is v1.7602] You might want to try install Bundle::CPAN reload cpan without quitting the current session. It should be a seamless upgrad +e while we are running...
      This will get you past the problems with the continent selection.