Update CPANPLUS to CPAN version 0.9107
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Tue, 12 Jul 2011 15:04:46 +0000 (16:04 +0100)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Tue, 12 Jul 2011 15:04:46 +0000 (16:04 +0100)
  [DELTA]

  Changes for 0.9107      Tue Jul 12 15:22:14 2011
  ================================================
  * Add support for v-strings and x.y.z versions, using the version module.
  * Resolve [rt.cpan.org #69420] "type checking for CPANPLUS::Backend::RV::new is incorrect"
  * Resolve [rt.cpan.org #69203] "custom sources ignores timeout config option"

Porting/Maintainers.pl
cpan/CPANPLUS/lib/CPANPLUS.pm
cpan/CPANPLUS/lib/CPANPLUS/Backend.pm
cpan/CPANPLUS/lib/CPANPLUS/Internals.pm
cpan/CPANPLUS/lib/CPANPLUS/Internals/Source.pm
cpan/CPANPLUS/lib/CPANPLUS/Internals/Utils.pm
cpan/CPANPLUS/lib/CPANPLUS/Selfupdate.pm
cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm
cpan/CPANPLUS/t/00_CPANPLUS-Internals-Utils.t
pod/perldelta.pod

index 8c51685..dd80e3a 100755 (executable)
@@ -459,7 +459,7 @@ use File::Glob qw(:case);
     'CPANPLUS' =>
        {
        'MAINTAINER'    => 'kane',
-       'DISTRIBUTION'  => 'BINGOS/CPANPLUS-0.9106.tar.gz',
+       'DISTRIBUTION'  => 'BINGOS/CPANPLUS-0.9107.tar.gz',
        'FILES'         => q[cpan/CPANPLUS],
        'EXCLUDED'      => [ qr{^inc/},
                             qr{^t/dummy-.*\.hidden$},
@@ -470,7 +470,7 @@ use File::Glob qw(:case);
                                 t/031_CPANPLUS-Internals-Source-SQLite.t
                                 t/032_CPANPLUS-Internals-Source-via-sqlite.t
                               },
-                             qw{ Makefile.PL },
+           qw{ Makefile.PL },
                           ],
        'CUSTOMIZED'    => [ qw{ Makefile.PL } ],
        'UPSTREAM'      => 'cpan',
index 7496688..0f6607b 100644 (file)
@@ -13,7 +13,7 @@ BEGIN {
     use vars        qw( @EXPORT @ISA $VERSION );
     @EXPORT     =   qw( shell fetch get install );
     @ISA        =   qw( Exporter );
-    $VERSION = "0.9106";     #have to hardcode or cpan.org gets unhappy
+    $VERSION = "0.9107";     #have to hardcode or cpan.org gets unhappy
 }
 
 ### purely for backward compatibility, so we can call it from the commandline:
index 0d945d5..1ea8881 100644 (file)
@@ -397,7 +397,7 @@ for my $func (qw[fetch extract install readme files distributions]) {
 
         return CPANPLUS::Backend::RV->new(
                     function    => $func,
-                    ok          => !$flag,
+                    ok          => ( !$flag ? 1 : 0 ),
                     rv          => $href,
                     args        => \%hash,
                 );
index c882c93..f126e09 100644 (file)
@@ -42,7 +42,7 @@ use vars qw[@ISA $VERSION];
             CPANPLUS::Internals::Report
         ];
 
-$VERSION = "0.9106";
+$VERSION = "0.9107";
 
 =pod
 
index 342df63..b93cc1c 100644 (file)
@@ -1210,10 +1210,11 @@ sub __update_custom_module_source {
     ### so add it explicitly.
     my $dir =  tempdir( CLEANUP => 1 );
 
-    my $res =  do {  local $File::Fetch::WARN = 0;
+    my $res =  do {
                     local $File::Fetch::WARN = 0;
+                    local $File::Fetch::TIMEOUT = $conf->get_conf('timeout');
                     $ff->fetch( to => $dir );
-                };
+               };
 
     ### couldn't get the file
     unless( $res ) {
index 46ddec8..bf475c9 100644 (file)
@@ -10,6 +10,7 @@ use File::Copy;
 use Params::Check               qw[check];
 use Module::Load::Conditional   qw[can_load];
 use Locale::Maketext::Simple    Class => 'CPANPLUS', Style => 'gettext';
+use version;
 
 local $Params::Check::VERBOSE = 1;
 
@@ -199,7 +200,8 @@ sub _version_to_number {
 
     check( $tmpl, \%hash ) or return;
 
-    return $version if $version =~ /^\.?\d/;
+    return $version if $version =~ /^\d*(?:\.\d+)?$/;
+    return eval { version->parse($1)->numify } if $version =~ /^(v?\d+(?:\.\d+(?:\.\d+)?)?)/;
     return '0.0';
 }
 
@@ -374,7 +376,8 @@ sub _vcmp {
     my $self = shift;
     my ($x, $y) = @_;
 
-    s/_//g foreach $x, $y;
+    $x = $self->_version_to_number(version => $x);
+    $y = $self->_version_to_number(version => $y);
 
     return $x <=> $y;
 }
index 963f8ba..e27f98b 100644 (file)
@@ -49,7 +49,7 @@ CPANPLUS::Selfupdate
             'Module::Load'              => '0.10',
             'Module::Load::Conditional' => '0.38', # returns dir for loaded
                                                    # modules
-            'version'                   => '0.73', # needed for M::L::C
+            'version'                   => '0.77', # needed for M::L::C
                                                    # addresses #24630 and
                                                    # #24675
                                                    # Address ~0 overflow issue
index db75c44..9bfe3e5 100644 (file)
@@ -26,7 +26,7 @@ local $Data::Dumper::Indent     = 1; # for dumpering from !
 BEGIN {
     use vars        qw[ $VERSION @ISA ];
     @ISA        =   qw[ CPANPLUS::Shell::_Base::ReadLine ];
-    $VERSION = "0.9106";
+    $VERSION = "0.9107";
 }
 
 load CPANPLUS::Shell;
index dc9dcff..e15dcb2 100644 (file)
@@ -8,7 +8,7 @@ use strict;
 
 ### make sure to keep the plan -- this is the only test
 ### supported for 'older' T::H (pre 2.28) -- see Makefile.PL for details
-use Test::More tests => 40;
+use Test::More tests => 48;
 
 use Cwd;
 use Data::Dumper;
@@ -116,11 +116,15 @@ rmdir $Dir  if -d $Dir;
 
 ### _version_to_number tests ###
 {   my $map = {
-        '1'     => '1',
-        '1.2'   => '1.2',
-        '.2'    => '.2',
-        'foo'   => '0.0',
-        'a.1'   => '0.0',
+        '1'      => '1',
+        '1.2'    => '1.2',
+        '.2'     => '.2',
+        'foo'    => '0.0',
+        'a.1'    => '0.0',
+        '1.2.3'  => '1.002003',
+        'v1.2.3' => '1.002003',
+        'v1.5'   => '1.005000',
+        '1.5-a'  => '1.500',
     };
 
     while( my($try,$expect) = each %$map ) {
index b91d66c..723914c 100644 (file)
@@ -192,7 +192,7 @@ IO::Compress::Zip when the content size was exactly 0xFFFFFFFF.
 
 =item *
 
-L<CPANPLUS> has been upgraded from version 0.9105 to version 0.9106
+L<CPANPLUS> has been upgraded from version 0.9105 to version 0.9107
 
 =item *