This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update CPAN.pm to 1.93_53
authorAndreas J Koenig <andreas.koenig.7os6VVqR@franz.ak.mind.de>
Mon, 4 May 2009 06:23:18 +0000 (08:23 +0200)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 4 May 2009 07:40:01 +0000 (09:40 +0200)
lib/CPAN.pm
lib/CPAN/Distroprefs.pm
lib/CPAN/FirstTime.pm
lib/CPAN/Module.pm

index e7475b8..14243a8 100644 (file)
@@ -2,7 +2,7 @@
 # vim: ts=4 sts=4 sw=4:
 use strict;
 package CPAN;
 # vim: ts=4 sts=4 sw=4:
 use strict;
 package CPAN;
-$CPAN::VERSION = '1.93_52';
+$CPAN::VERSION = '1.93_53';
 $CPAN::VERSION =~ s/_//;
 
 # we need to run chdir all over and we would get at wrong libraries
 $CPAN::VERSION =~ s/_//;
 
 # we need to run chdir all over and we would get at wrong libraries
@@ -3455,8 +3455,7 @@ You will most probably also want to configure something like this:
                     INSTALLSCRIPT=~/myperl/bin \
                     INSTALLBIN=~/myperl/bin"
 
                     INSTALLSCRIPT=~/myperl/bin \
                     INSTALLBIN=~/myperl/bin"
 
-and then (oh joy) the equivalent command for Module::Build. That would
-be
+and then the equivalent command for Module::Build, which is
 
   o conf mbuildpl_arg "--lib=~/myperl/lib \
                     --installman1dir=~/myperl/man/man1 \
 
   o conf mbuildpl_arg "--lib=~/myperl/lib \
                     --installman1dir=~/myperl/man/man1 \
index 561137f..e1be9cd 100644 (file)
@@ -326,7 +326,7 @@ CPAN::Distroprefs -- read and match distroprefs
 
         die $result->as_string if $result->is_fatal;
 
 
         die $result->as_string if $result->is_fatal;
 
-        warn $result->as_string, next if $result->is_warning;
+        warn($result->as_string), next if $result->is_warning;
 
         for my $pref (@{ $result->prefs }) {
             if ($pref->matches(\%info)) {
 
         for my $pref (@{ $result->prefs }) {
             if ($pref->matches(\%info)) {
index 9f0c695..8b5f6ba 100644 (file)
@@ -1409,7 +1409,7 @@ Shall I use the local database in $mby?};
     }
     local $urllist = $CPAN::Config->{urllist};
     my $better_mby;
     }
     local $urllist = $CPAN::Config->{urllist};
     my $better_mby;
   while () { # multiple errors possible
LOOP: while () { # multiple errors possible
         if ($use_mby
             or (defined $CPAN::Config->{connect_to_internet_ok}
                 and $CPAN::Config->{connect_to_internet_ok})){
         if ($use_mby
             or (defined $CPAN::Config->{connect_to_internet_ok}
                 and $CPAN::Config->{connect_to_internet_ok})){
@@ -1432,12 +1432,12 @@ Shall I use the local database in $mby?};
                 $better_mby = CPAN::FTP->localize($m,$mby,3);
                 $use_mby=1 if $mby;
             } else {
                 $better_mby = CPAN::FTP->localize($m,$mby,3);
                 $use_mby=1 if $mby;
             } else {
-                last;
+                last LOOP;
             }
             if ($better_mby) {
                 $mby = $better_mby;
             }
             }
             if ($better_mby) {
                 $mby = $better_mby;
             }
-        } elsif (not @$urllist
+        } elsif (not @{$urllist||[]}
                  and (not defined $CPAN::Config->{connect_to_internet_ok}
                       or not $CPAN::Config->{connect_to_internet_ok})) {
             $CPAN::Frontend->myprint(qq{CPAN needs access to at least one CPAN mirror.
                  and (not defined $CPAN::Config->{connect_to_internet_ok}
                       or not $CPAN::Config->{connect_to_internet_ok})) {
             $CPAN::Frontend->myprint(qq{CPAN needs access to at least one CPAN mirror.
@@ -1449,10 +1449,10 @@ a valid CPAN URL now.\n\n});
             my $ans = prompt("Please enter the URL of your CPAN mirror",shift @default);
             if ($ans) {
                 push @$urllist, $ans;
             my $ans = prompt("Please enter the URL of your CPAN mirror",shift @default);
             if ($ans) {
                 push @$urllist, $ans;
-                next;
+                next LOOP;
             }
         } else {
             }
         } else {
-            last;
+            last LOOP;
         }
     }
     if ($use_mby){
         }
     }
     if ($use_mby){
index f9520d9..eae5a73 100644 (file)
@@ -652,10 +652,15 @@ sub available_version {
 #-> sub CPAN::Module::parse_version ;
 sub parse_version {
     my($self,$parsefile) = @_;
 #-> sub CPAN::Module::parse_version ;
 sub parse_version {
     my($self,$parsefile) = @_;
-    my $have = eval { MM->parse_version($parsefile); };
+    alarm(10);
+    my $have = eval {
+        local $SIG{ALRM} = sub { die "alarm\n" };
+        MM->parse_version($parsefile);
+    };
     if ($@) {
         $CPAN::Frontend->mywarn("Error while parsing version number in file '$parsefile'\n");
     }
     if ($@) {
         $CPAN::Frontend->mywarn("Error while parsing version number in file '$parsefile'\n");
     }
+    alarm(0);
     my $leastsanity = eval { defined $have && length $have; };
     $have = "undef" unless $leastsanity;
     $have =~ s/^ //; # since the %vd hack these two lines here are needed
     my $leastsanity = eval { defined $have && length $have; };
     $have = "undef" unless $leastsanity;
     $have =~ s/^ //; # since the %vd hack these two lines here are needed