In perl.git, the branch maint-5.10 has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/bb07d7bde9c88e2ed0287c8ec2708b703892795e?hp=676c8ade29535aa1312c8a6416c41eb38ff1e312>

- Log -----------------------------------------------------------------
commit bb07d7bde9c88e2ed0287c8ec2708b703892795e
Author: David Mitchell <[email protected]>
Date:   Mon Jul 6 21:08:18 2009 +0100

    bump CPANPLUS version in maint Maintainers.pl

M       Porting/Maintainers.pl

commit 5d3a4d9f978bcc9cd4d936b631408ebb425fab97
Author: Jos I. Boumans <[email protected]>
Date:   Sat Jun 27 17:57:28 2009 +0200

    Update CPANPLUS to 0.87_03
    
    (cherry picked from commit a3de5d0b2ac804ed0e6a548da0ff3bd4e91331c7)

M       lib/CPANPLUS.pm
M       lib/CPANPLUS/Backend.pm
M       lib/CPANPLUS/Internals.pm
M       lib/CPANPLUS/Internals/Constants.pm
M       lib/CPANPLUS/Internals/Report.pm
M       lib/CPANPLUS/Shell/Default.pm
M       lib/CPANPLUS/bin/cpanp
M       lib/CPANPLUS/t/08_CPANPLUS-Backend.t
M       lib/CPANPLUS/t/dummy-CPAN/authors/01mailrc.txt.gz.packed
M       
lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Bundle-Foo-Bar-0.01.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Foo-Bar-0.01.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/perl5.005_03.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/authors/id/EUXS/Foo-Bar-0.01.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/authors/id/MBNOXS/Foo-Bar-0.01.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/authors/id/MBXS/Foo-Bar-0.01.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/modules/02packages.details.txt.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/modules/03modlist.data.gz.packed

commit 637ec013141a57054fc591118e64b4a8c29eeebe
Author: David Mitchell <[email protected]>
Date:   Tue Jun 23 23:06:18 2009 +0100

    sync lib/CPANPLUS/Backend.pm with CPAN
    
    (just a whitespace change)
    
    (cherry picked from commit 0b179affb5133456355a83ef45ff8b719e86cf01)

M       lib/CPANPLUS/Backend.pm

commit 86bd33ae8c3288b4ba908dfe39ca83b308b1c547
Author: Jos I. Boumans <[email protected]>
Date:   Sat Jun 13 13:59:45 2009 +0200

    Update CPANPLUS to 0.87_02
    
    (cherry picked from commit 19be90356d8bfc8d9e80a87a93eb2ab3d212d1b5)

M       lib/CPANPLUS.pm
M       lib/CPANPLUS/Internals.pm
M       lib/CPANPLUS/Shell/Default.pm
M       lib/CPANPLUS/t/dummy-CPAN/authors/01mailrc.txt.gz.packed
M       
lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Bundle-Foo-Bar-0.01.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Foo-Bar-0.01.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/perl5.005_03.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/authors/id/EUXS/Foo-Bar-0.01.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/authors/id/MBNOXS/Foo-Bar-0.01.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/authors/id/MBXS/Foo-Bar-0.01.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/modules/02packages.details.txt.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/modules/03modlist.data.gz.packed

commit 5dafdef90f595d63a8ef1c9b123bf8420bccc72e
Author: Jos I. Boumans <[email protected]>
Date:   Sat Jun 13 10:04:46 2009 +0200

    Update to CPANPLUS 0.87_01
    
    (cherry picked from commit a0995fd479a7e2e390969122c63171250070a660)

M       lib/CPANPLUS.pm
M       lib/CPANPLUS/Backend.pm
M       lib/CPANPLUS/Config.pm
M       lib/CPANPLUS/Dist.pm
M       lib/CPANPLUS/Dist/MM.pm
M       lib/CPANPLUS/Internals.pm
M       lib/CPANPLUS/Internals/Constants.pm
M       lib/CPANPLUS/Internals/Source.pm
M       lib/CPANPLUS/Internals/Source/Memory.pm
M       lib/CPANPLUS/Module.pm
M       lib/CPANPLUS/Shell/Default.pm
M       lib/CPANPLUS/t/08_CPANPLUS-Backend.t
M       lib/CPANPLUS/t/20_CPANPLUS-Dist-MM.t
M       lib/CPANPLUS/t/dummy-CPAN/authors/01mailrc.txt.gz.packed
M       
lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Bundle-Foo-Bar-0.01.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Foo-Bar-0.01.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/perl5.005_03.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/authors/id/EUXS/Foo-Bar-0.01.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/authors/id/MBNOXS/Foo-Bar-0.01.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/authors/id/MBXS/Foo-Bar-0.01.tar.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/modules/02packages.details.txt.gz.packed
M       lib/CPANPLUS/t/dummy-CPAN/modules/03modlist.data.gz.packed
-----------------------------------------------------------------------

Summary of changes:
 Porting/Maintainers.pl                             |    2 +-
 lib/CPANPLUS.pm                                    |    2 +-
 lib/CPANPLUS/Backend.pm                            |   56 +++++++++++++++++++-
 lib/CPANPLUS/Config.pm                             |    2 +-
 lib/CPANPLUS/Dist.pm                               |    2 +-
 lib/CPANPLUS/Dist/MM.pm                            |    9 ++--
 lib/CPANPLUS/Internals.pm                          |    2 +-
 lib/CPANPLUS/Internals/Constants.pm                |    9 ++--
 lib/CPANPLUS/Internals/Report.pm                   |    4 +-
 lib/CPANPLUS/Internals/Source.pm                   |   41 +++++++++++---
 lib/CPANPLUS/Internals/Source/Memory.pm            |    6 ++-
 lib/CPANPLUS/Module.pm                             |    2 +-
 lib/CPANPLUS/Shell/Default.pm                      |   46 +++++++++++++---
 lib/CPANPLUS/bin/cpanp                             |    3 +-
 lib/CPANPLUS/t/08_CPANPLUS-Backend.t               |    9 +++-
 lib/CPANPLUS/t/20_CPANPLUS-Dist-MM.t               |    6 ++
 .../t/dummy-CPAN/authors/01mailrc.txt.gz.packed    |    2 +-
 .../id/EUNOXS/Bundle-Foo-Bar-0.01.tar.gz.packed    |    2 +-
 .../authors/id/EUNOXS/Foo-Bar-0.01.tar.gz.packed   |    2 +-
 .../authors/id/EUNOXS/perl5.005_03.tar.gz.packed   |    2 +-
 .../authors/id/EUXS/Foo-Bar-0.01.tar.gz.packed     |    2 +-
 .../authors/id/MBNOXS/Foo-Bar-0.01.tar.gz.packed   |    2 +-
 .../authors/id/MBXS/Foo-Bar-0.01.tar.gz.packed     |    2 +-
 .../modules/02packages.details.txt.gz.packed       |   22 ++++----
 .../t/dummy-CPAN/modules/03modlist.data.gz.packed  |    2 +-
 25 files changed, 181 insertions(+), 58 deletions(-)

diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index d897b42..5529340 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -449,7 +449,7 @@ package Maintainers;
     'CPANPLUS' =>
        {
        'MAINTAINER'    => 'kane',
-       'DISTRIBUTION'  => 'KANE/CPANPLUS-0.8601.tar.gz',
+       'DISTRIBUTION'  => 'KANE/CPANPLUS-0.87_03.tar.gz',
        'FILES'         => q[lib/CPANPLUS.pm
                             lib/CPANPLUS/Backend
                             lib/CPANPLUS/Backend.pm
diff --git a/lib/CPANPLUS.pm b/lib/CPANPLUS.pm
index a4b9569..a31fa3b 100644
--- a/lib/CPANPLUS.pm
+++ b/lib/CPANPLUS.pm
@@ -13,7 +13,7 @@ BEGIN {
     use vars        qw( @EXPORT @ISA $VERSION );
     @EXPORT     =   qw( shell fetch get install );
     @ISA        =   qw( Exporter );
-    $VERSION = "0.8601";     #have to hardcode or cpan.org gets unhappy
+    $VERSION = "0.87_03";     #have to hardcode or cpan.org gets unhappy
 }
 
 ### purely for backward compatibility, so we can call it from the commandline:
diff --git a/lib/CPANPLUS/Backend.pm b/lib/CPANPLUS/Backend.pm
index fb71fcf..71953e7 100644
--- a/lib/CPANPLUS/Backend.pm
+++ b/lib/CPANPLUS/Backend.pm
@@ -14,6 +14,7 @@ use CPANPLUS::Backend::RV;
 use FileHandle;
 use File::Spec                  ();
 use File::Spec::Unix            ();
+use File::Basename              ();
 use Params::Check               qw[check];
 use Locale::Maketext::Simple    Class => 'CPANPLUS', Style => 'gettext';
 
@@ -405,7 +406,7 @@ for my $func (qw[fetch extract install readme files 
distributions]) {
 
 =pod
 
-=head2 $mod_obj = $cb->parse_module( module => $modname|$distname|$modobj|URI )
+=head2 $mod_obj = $cb->parse_module( module => 
$modname|$distname|$modobj|URI|PATH )
 
 C<parse_module> tries to find a C<CPANPLUS::Module> object that
 matches your query. Here's a list of examples you could give to
@@ -429,6 +430,12 @@ C<parse_module>;
 
 =item file:///tmp/Text-Bastardize-1.06.tar.gz
 
+=item /tmp/Text-Bastardize-1.06
+
+=item ./Text-Bastardize-1.06
+
+=item .
+
 =back
 
 These items would all come up with a C<CPANPLUS::Module> object for
@@ -436,6 +443,11 @@ C<Text::Bastardize>. The ones marked explicitly as being 
version 1.06
 would give back a C<CPANPLUS::Module> object of that version.
 Even if the version on CPAN is currently higher.
 
+The last three are examples of PATH resolution. In the first, we supply
+an absolute path to the unwrapped distribution. In the second the 
+distribution is relative to the current working directory.
+In the third, we will use the current working directory.
+
 If C<parse_module> is unable to actually find the module you are looking
 for in its module tree, but you supplied it with an author, module
 and version part in a distribution name or URI, it will create a fake
@@ -480,6 +492,48 @@ sub parse_module {
         return $maybe if IS_MODOBJ->( module => $maybe );
     }
 
+    ### Special case arbitary file paths such as '.' etc.
+    if (-d File::Spec->rel2abs($mod) ) {
+        my $dir    = File::Spec->rel2abs($mod);
+        my $parent = File::Spec->rel2abs( File::Spec->catdir( $dir, '..' ) );
+
+        ### fix paths on VMS
+        if (ON_VMS) {
+            $dir    = VMS::Filespec::unixify($dir);
+            $parent = VMS::Filespec::unixify($parent);
+        }
+
+        my $dist   = $mod = File::Basename::basename($dir);
+        $dist     .= '-0'      unless $dist =~ /\-[0-9._]+$/;
+        $dist     .= '.tar.gz' unless $dist =~ /\.[A-Za-z]+$/;
+
+        my $modobj = CPANPLUS::Module::Fake->new(
+                        module  => $mod,
+                        version => 0,
+                        package => $dist,
+                        path    => $parent,
+                        author  => CPANPLUS::Module::Author::Fake->new
+                    );
+
+        ### better guess for the version
+        $modobj->version( $modobj->package_version ) 
+            if defined $modobj->package_version;
+        
+        ### better guess at module name, if possible
+        if ( my $pkgname = $modobj->package_name ) {
+            $pkgname =~ s/-/::/g;
+        
+            ### no sense replacing it unless we changed something
+            $modobj->module( $pkgname ) 
+                if ($pkgname ne $modobj->package_name) || $pkgname !~ /-/;
+        }                
+
+        $modobj->status->fetch( $parent );
+        $modobj->status->extract( $dir );
+        $modobj->get_installer_type;
+        return $modobj;
+    }
+
     ### ok, so it looks like a distribution then?
     my @parts   = split '/', $mod;
     my $dist    = pop @parts;
diff --git a/lib/CPANPLUS/Config.pm b/lib/CPANPLUS/Config.pm
index 08c80df..28f4fb6 100644
--- a/lib/CPANPLUS/Config.pm
+++ b/lib/CPANPLUS/Config.pm
@@ -487,7 +487,7 @@ set it to:
 =item editor
 
 A string holding the path to your editor of choice. Defaults to your
-$ENV{EDITOR}, $ENV{VISIUAL}, 'vi' or 'pico' programs, in that order.
+$ENV{EDITOR}, $ENV{VISUAL}, 'vi' or 'pico' programs, in that order.
 
 =cut
 
diff --git a/lib/CPANPLUS/Dist.pm b/lib/CPANPLUS/Dist.pm
index 8c881bf..4bbbd1d 100644
--- a/lib/CPANPLUS/Dist.pm
+++ b/lib/CPANPLUS/Dist.pm
@@ -319,7 +319,7 @@ sub find_configure_requires {
   
         unless( $doc ) {
             error(loc( "Could not read %1: '%2'", $meta, $@ ));
-            return;
+            return $configure_requires; # Causes problems if we don't return a 
hashref
         }
 
         ### read the configure_requires key, make sure not to throw
diff --git a/lib/CPANPLUS/Dist/MM.pm b/lib/CPANPLUS/Dist/MM.pm
index e8fe3cd..5baa24f 100644
--- a/lib/CPANPLUS/Dist/MM.pm
+++ b/lib/CPANPLUS/Dist/MM.pm
@@ -1,5 +1,6 @@
 package CPANPLUS::Dist::MM;
 
+use warnings;
 use strict;
 use vars    q...@isa $STATUS];
 use base    'CPANPLUS::Dist::Base';
@@ -216,14 +217,14 @@ sub prepare {
     }
     
     my $args;
-    my( $force, $verbose, $perl, $mmflags, $prereq_target, $prereq_format,
+    my( $force, $verbose, $perl, @mmflags, $prereq_target, $prereq_format,
         $prereq_build );
     {   local $Params::Check::ALLOW_UNKNOWN = 1;
         my $tmpl = {
             perl            => {    default => $^X, store => \$perl },
             makemakerflags  => {    default =>
                                         $conf->get_conf('makemakerflags') || 
'',
-                                    store => \$mmflags },                 
+                                    store => \$mmflags[0] },
             force           => {    default => $conf->get_conf('force'), 
                                     store   => \$force },
             verbose         => {    default => $conf->get_conf('verbose'), 
@@ -361,7 +362,7 @@ sub prepare {
             # my $cmd     = "$perl $flush $makefile_pl $mmflags";
 
             my $run_perl    = $conf->get_program('perlwrapper');
-            my $cmd         = "$perl $run_perl $makefile_pl $mmflags";
+            my $cmd         = [$perl, $run_perl, $makefile_pl, @mmflags];
 
             ### set ENV var to tell underlying code this is what we're
             ### executing.
@@ -540,7 +541,7 @@ sub create {
     
     my $args;
     my( $force, $verbose, $make, $makeflags, $skiptest, $prereq_target, $perl, 
-        $mmflags, $prereq_format, $prereq_build);
+        @mmflags, $prereq_format, $prereq_build);
     {   local $Params::Check::ALLOW_UNKNOWN = 1;
         my $tmpl = {
             perl            => {    default => $^X, store => \$perl },
diff --git a/lib/CPANPLUS/Internals.pm b/lib/CPANPLUS/Internals.pm
index f5d961b..3bc0ea7 100644
--- a/lib/CPANPLUS/Internals.pm
+++ b/lib/CPANPLUS/Internals.pm
@@ -42,7 +42,7 @@ use vars q...@isa $VERSION];
             CPANPLUS::Internals::Report
         ];
 
-$VERSION = "0.8601";
+$VERSION = "0.87_03";
 
 =pod
 
diff --git a/lib/CPANPLUS/Internals/Constants.pm 
b/lib/CPANPLUS/Internals/Constants.pm
index f467f78..d891fbd 100644
--- a/lib/CPANPLUS/Internals/Constants.pm
+++ b/lib/CPANPLUS/Internals/Constants.pm
@@ -278,13 +278,13 @@ use constant CPANPLUS_UA    => sub { ### for the version 
number ###
                                      "CPANPLUS/$CPANPLUS::Internals::VERSION" 
                                 };
 use constant TESTERS_URL    => sub {
-                                    "http://testers.cpan.org/show/"; .
-                                    $_[0] .".yaml" 
+                                    'http://cpantesters.org/distro/'.
+                                    uc(substr($_[0],0,1)) .'/'. $_[0] . 
'.yaml';
                                 };
 use constant TESTERS_DETAILS_URL
                             => sub {
-                                    'http://testers.cpan.org/show/' .
-                                    $_[0] . '.html';
+                                    'http://cpantesters.org/distro/'.
+                                    uc(substr($_[0],0,1)) .'/'. $_[0];
                                 };         
 
 use constant CREATE_FILE_URI    
@@ -316,6 +316,7 @@ use constant CALLING_FUNCTION
                                      return join '::', (caller(2+$lvl))[3] 
                                 };
 use constant PERL_CORE      => 'perl';
+use constant STORABLE_EXT   => '.stored';
 
 use constant GET_XS_FILES   => sub { my $dir = $_[0] or return;
                                      require File::Find;
diff --git a/lib/CPANPLUS/Internals/Report.pm b/lib/CPANPLUS/Internals/Report.pm
index 6ce44af..2e793d3 100644
--- a/lib/CPANPLUS/Internals/Report.pm
+++ b/lib/CPANPLUS/Internals/Report.pm
@@ -214,8 +214,8 @@ sub _query_report {
         $href->{'details'}  = $details;
         
         ### backwards compatibility :(
-        $href->{'dist'}     = delete $href->{'distversion'};
-        $href->{'grade'}    = delete $href->{'action'};
+        $href->{'dist'}     ||= $href->{'distversion'};
+        $href->{'grade'}    ||= $href->{'action'} || $href->{'status'};
 
         push @rv, $href;
     }
diff --git a/lib/CPANPLUS/Internals/Source.pm b/lib/CPANPLUS/Internals/Source.pm
index 1a322cb..1d4a2d3 100644
--- a/lib/CPANPLUS/Internals/Source.pm
+++ b/lib/CPANPLUS/Internals/Source.pm
@@ -191,14 +191,14 @@ sub _build_trees {
                 uptodate    => $uptodate,
                 path        => $path,
                 verbose     => $verbose, 
-        );
+        ) or return;
 
         ### and now the module tree
         $self->_create_mod_tree(
                 uptodate    => $uptodate,
                 path        => $path,
                 verbose     => $verbose, 
-        );
+        ) or return;
     }
     
     ### XXX unpleasant hack. since custom sources uses ->parse_module, we
@@ -628,20 +628,43 @@ sub _create_mod_tree {
         $ae->extract( to => $out )                              or return;
     }
 
-    my $cont    = $self->_get_file_contents( file => $out ) or return;
+    my $content = $self->_get_file_contents( file => $out ) or return;
+    my $lines   = $content =~ tr/\n/\n/;
 
     ### don't need it anymore ###
     unlink $out;
 
-    my $flag;
-
-    for ( split /\n/, $cont ) {
+    my($past_header, $count);
+    for ( split /\n/, $content ) {
 
         ### quick hack to read past the header of the file ###
         ### this is still rather evil... fix some time - Kane
-        $flag = 1 if m|^\s*$|;
-        next unless $flag;
-
+        if( m|^\s*$| ) {
+            unless( $count ) {
+                error(loc("Could not determine line count from %1", $file));
+                return;
+            }
+            $past_header = 1;
+        }            
+        
+        ### we're still in the header -- find the amount of lines we expect
+        unless( $past_header ) {
+            
+            ### if the line count doesn't match what we expect, bail out
+            ### this should address: #45644: detect broken index
+            $count = $1 if /^Line-Count:\s+(\d+)/;
+            if( $count ) {
+                if( $lines < $count ) {
+                    error(loc("Expected to read at least %1 lines, but %2 ".
+                              "contains only %3 lines!",
+                              $count, $file, $lines ));
+                    return;
+                }  
+            }
+            ### still in the header, keep moving
+            next;
+        }
+        
         ### skip empty lines ###
         next unless /\S/;
         chomp;
diff --git a/lib/CPANPLUS/Internals/Source/Memory.pm 
b/lib/CPANPLUS/Internals/Source/Memory.pm
index fc108d5..cb3fd4f 100644
--- a/lib/CPANPLUS/Internals/Source/Memory.pm
+++ b/lib/CPANPLUS/Internals/Source/Memory.pm
@@ -350,9 +350,11 @@ sub __memory_storable_file {
         File::Spec->catfile(
             $path,                          #base dir
             $conf->_get_source('stored')    #file
-            . '.' .
+            . '.s' .
             $Storable::VERSION              #the version of storable 
-            . '.stored'                     #append a suffix
+            . '.c' .
+            $self->VERSION                  #the version of CPANPLUS
+            . STORABLE_EXT                  #append a suffix
         )
     );
 
diff --git a/lib/CPANPLUS/Module.pm b/lib/CPANPLUS/Module.pm
index b5602e1..3fc1462 100644
--- a/lib/CPANPLUS/Module.pm
+++ b/lib/CPANPLUS/Module.pm
@@ -677,7 +677,7 @@ sub get_installer_type {
 
     ### ok, so it's a 'build' installer, but you don't /have/ module build
     ### XXX duplicated from CPANPLUS::Selfupdate. fix somehow?
-    if( $type eq INSTALLER_BUILD and (
+    if( $type and $type eq INSTALLER_BUILD and (
         not CPANPLUS::Dist->has_dist_type( INSTALLER_BUILD )
         or not $cb->module_tree( INSTALLER_BUILD )
                     ->is_uptodate( version => '0.24' )
diff --git a/lib/CPANPLUS/Shell/Default.pm b/lib/CPANPLUS/Shell/Default.pm
index 8e059f7..25d68ae 100644
--- a/lib/CPANPLUS/Shell/Default.pm
+++ b/lib/CPANPLUS/Shell/Default.pm
@@ -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.8601";
+    $VERSION = "0.87_03";
 }
 
 load CPANPLUS::Shell;
@@ -104,6 +104,7 @@ CPANPLUS::Shell::Default
     cpanp> i Acme::Foo       # install Acme::Foo
     cpanp> i Acme-Foo-1.3    # install version 1.3 of Acme::Foo
     cpanp> i <URI>           # install from URI, like ftp://foo.com/X.tgz
+    cpanp> i <DIR>           # install from an absolute or relative directory
     cpanp> i 1 3..5          # install search results 1, 3, 4 and 5
     cpanp> i *               # install all search results
     cpanp> a KANE; i *;      # find modules by kane, install all results
@@ -278,7 +279,9 @@ sub dispatch_on_input {
     ### prompt after the command has finished.
     $self->noninteractive($noninteractive) if defined $noninteractive;
 
-    my @cmds =  split ';', $string;
+    my $rv = 1;
+    
+    my @cmds = split ';', $string;
     while( my $input = shift @cmds ) {
 
         ### to send over the socket ###
@@ -324,8 +327,11 @@ sub dispatch_on_input {
         my $method = $map->{$key};
 
         ### dispatch meta locally at all times ###
-        $self->$method(input => $input, options => $options), next
-            if $key eq '/';
+        if( $key eq '/' ) {
+            ### keep track of failures
+            $rv *= length $self->$method(input => $input, options => $options);
+            next;
+        }
 
         ### flush unless we're trying to print the stack
         CPANPLUS::Error->flush unless $key eq 'p';
@@ -348,6 +354,9 @@ sub dispatch_on_input {
                 $self->__print( "\n", loc("Command failed!"), "\n\n" )
                     unless $status;
 
+                ### keep track of failures
+                $rv *= length $status;
+
                 $self->_pager_open if $buff =~ tr/\n// > $self->_term_rowcount;
                 $self->__print( $buff );
                 $self->_pager_close;
@@ -367,7 +376,9 @@ sub dispatch_on_input {
                 @mods = $self->_select_modules($input)
                         unless grep {$key eq $_} qw[! m a v w x p s b / ? h];
 
-                eval { $self->$method(  modules => \...@mods,
+                ### keep track of failures
+                $rv *= defined eval { $self->$method(   
+                                        modules => \...@mods,
                                         options => $options,
                                         input   => $input,
                                         choice  => $key )
@@ -377,6 +388,9 @@ sub dispatch_on_input {
         }
     }
 
+    ### outside the shell loop, we can return the actual return value;
+    return $rv if $self->noninteractive;
+
     return;
 }
 
@@ -488,6 +502,8 @@ sub __display_results {
     } else {
         $self->__print( loc("No results to display"), "\n" );
     }
+    
+    return 1;
 }
 
 
@@ -498,6 +514,8 @@ sub _quit {
             if defined $rc->{'logout'};
 
     $self->__print( loc("Exiting CPANPLUS shell"), "\n" );
+    
+    return 1;
 }
 
 ###########################
@@ -536,6 +554,7 @@ loc('    w                      # display the result of 
your last search again'
 loc('[Operations]'                                                             
     ),
 loc('    i MODULE | NUMBER ...  # install module(s), by name or by search 
number'   ),
 loc('    i URI | ...            # install module(s), by URI (ie 
http://foo.com/X.tgz)'   ),
+loc('    i DIR | ...            # install module(s), by path (ie 
./Module-1.0)'   ),
 loc('    t MODULE | NUMBER ...  # test module(s), by name or by search number' 
     ),
 loc('    u MODULE | NUMBER ...  # uninstall module(s), by name or by search 
number' ),
 loc('    d MODULE | NUMBER ...  # download module(s)'                          
     ),
@@ -573,6 +592,8 @@ loc('   /? [PLUGIN NAME]        # show usage for (a 
particular) plugin(s)'  ),
         $self->__print( map {"$_\n"} @help );
         $self->__print( $/ );
         $self->_pager_close;
+    
+        return 1;
     }
 }
 
@@ -597,7 +618,9 @@ sub _bang {
     eval $input;
     error( $@ ) if $@;
     $self->__print( "\n" );
-    return;
+
+    return if $@;
+    return 1;
 }
 
 sub _search_module {
@@ -722,9 +745,12 @@ sub _fetch {
     }
 
     $self->_pager_open if @$mods >= $self->_term_rowcount;
+    my $rv = 1;
     for my $mod (@$mods) {
         my $where = $mod->fetch( %$opts );
 
+        $rv *= length $where;
+
         $self->__print(
             $where
                 ? loc("Successfully fetched '%1' to '%2'",
@@ -734,7 +760,9 @@ sub _fetch {
         $self->__print( "\n" );
     }
     $self->_pager_close;
-
+    
+    return 1 if $rv;
+    return;
 }
 
 sub _shell {
@@ -813,7 +841,7 @@ sub _distributions {
     $self->cache([undef,@rv]);
     $self->__display_results;
 
-    return; 1;
+    return 1;
 }
 
 sub _reload_indices {
@@ -1600,7 +1628,6 @@ sub _reports {
     return 1;
 }
 
-
 ### Load plugins
 {   my @PluginModules;
     my %Dispatch = ( 
@@ -1614,6 +1641,7 @@ sub _reports {
     
     my $init_done;
     sub _plugins_init {
+
         ### only initialize once
         return if $init_done++;
         
diff --git a/lib/CPANPLUS/bin/cpanp b/lib/CPANPLUS/bin/cpanp
index b1a8f9e..a493322 100644
--- a/lib/CPANPLUS/bin/cpanp
+++ b/lib/CPANPLUS/bin/cpanp
@@ -20,7 +20,8 @@ if (@ARGV) {
     ### strip the leading dash
     $input =~ s/^\s*-//;
     ### pass the command line to the shell
-    $shell->dispatch_on_input(input => $input, noninteractive => 1);
+    ### exit with a useful return value on return
+    exit not $shell->dispatch_on_input(input => $input, noninteractive => 1);
 } else {
     ### open a shell for the user
     $shell->shell();
diff --git a/lib/CPANPLUS/t/08_CPANPLUS-Backend.t 
b/lib/CPANPLUS/t/08_CPANPLUS-Backend.t
index fbcaeca..73611e8 100644
--- a/lib/CPANPLUS/t/08_CPANPLUS-Backend.t
+++ b/lib/CPANPLUS/t/08_CPANPLUS-Backend.t
@@ -187,6 +187,11 @@ ok( IS_CONFOBJ->(conf => $conf_obj),    "Configure object 
found" );
             'IO-Stty',
             '.02',
         ],            
+        '.' => [
+            'CPANPLUS',
+            't',
+            '',
+        ],            
     );       
 
     while ( my($guess, $attr) = splice @map, 0, 2 ) {
@@ -204,7 +209,9 @@ ok( IS_CONFOBJ->(conf => $conf_obj),    "Configure object 
found" );
                                 "   Proper version found: $version" );
         is( $obj->package_version, $version,
                                 "       Found in package_version as well" );
-        is( $obj->package_name, $pkg_name,
+
+        ### VMS doesn't preserve case, so match them after normalizing case
+        is( uc($obj->package_name), uc($pkg_name),
                                 "   Proper package_name found: $pkg_name" );
         unlike( $obj->package_name, qr/\d/,
                                 "       No digits in package name" );
diff --git a/lib/CPANPLUS/t/20_CPANPLUS-Dist-MM.t 
b/lib/CPANPLUS/t/20_CPANPLUS-Dist-MM.t
index b4fd78d..241c6a2 100644
--- a/lib/CPANPLUS/t/20_CPANPLUS-Dist-MM.t
+++ b/lib/CPANPLUS/t/20_CPANPLUS-Dist-MM.t
@@ -152,6 +152,12 @@ SKIP: {
 
 
     SKIP: {   ### EU::Installed tests ###
+        ### EU::I sometimes fails. See:
+        ### #43292: ~/CPANPLUS-0.85_04 fails t/20_CPANPLUS-Dist-MM.t
+        ### #46890: ExtUtils::Installed + EU::MM PREFIX= don't always work
+        ### well together
+        skip( "ExtUtils::Installed issue #46890 prevents these tests from 
running reliably", 8 );
+    
     
         skip( "Old perl on cygwin detected " .
               "-- tests will fail due to known bugs", 8
diff --git a/lib/CPANPLUS/t/dummy-CPAN/authors/01mailrc.txt.gz.packed 
b/lib/CPANPLUS/t/dummy-CPAN/authors/01mailrc.txt.gz.packed
index 0bcb0fa..55d06df 100644
--- a/lib/CPANPLUS/t/dummy-CPAN/authors/01mailrc.txt.gz.packed
+++ b/lib/CPANPLUS/t/dummy-CPAN/authors/01mailrc.txt.gz.packed
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/authors/01mailrc.txt.gz 
lib/CPANPLUS/t/dummy-CPAN/authors/01mailrc.txt.gz.packed
 
-Created at Sun Apr 26 20:33:20 2009
+Created at Sat Jun 27 16:51:08 2009
 #########################################################################
 __UU__
 M'XL("%_EO$4``S`Q;6%I;')C+G1X=`!+S,E,+%9P#8T(5...@`#)=>*DM"2S)QB
diff --git 
a/lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Bundle-Foo-Bar-0.01.tar.gz.packed 
b/lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Bundle-Foo-Bar-0.01.tar.gz.packed
index bd58326..3e32332 100644
--- 
a/lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Bundle-Foo-Bar-0.01.tar.gz.packed
+++ 
b/lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Bundle-Foo-Bar-0.01.tar.gz.packed
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p 
lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Bundle-Foo-Bar-0.01.tar.gz 
lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Bundle-Foo-Bar-0.01.tar.gz.packed
 
-Created at Sun Apr 26 20:33:20 2009
+Created at Sat Jun 27 16:51:08 2009
 #########################################################################
 __UU__
 M'XL("!1%OT4"`T)U;F1L92U&;V\M0F%R+3`N,#$N=&%R`.V7:V_:,!2&^8I_
diff --git 
a/lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Foo-Bar-0.01.tar.gz.packed 
b/lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Foo-Bar-0.01.tar.gz.packed
index 553cbd3..d27ed94 100644
--- a/lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Foo-Bar-0.01.tar.gz.packed
+++ b/lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Foo-Bar-0.01.tar.gz.packed
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p 
lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Foo-Bar-0.01.tar.gz 
lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/Foo-Bar-0.01.tar.gz.packed
 
-Created at Sun Apr 26 20:33:20 2009
+Created at Sat Jun 27 16:51:08 2009
 #########################################################################
 __UU__
 M'XL(`#P*BD<``^V:;6_B1A"`\WE_Q214(I$.QQ@;)*<YE;M"$^E(JB37GG0]
diff --git 
a/lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/perl5.005_03.tar.gz.packed 
b/lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/perl5.005_03.tar.gz.packed
index ce9b8c7..21cf458 100644
--- a/lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/perl5.005_03.tar.gz.packed
+++ b/lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/perl5.005_03.tar.gz.packed
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p 
lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/perl5.005_03.tar.gz 
lib/CPANPLUS/t/dummy-CPAN/authors/id/EUNOXS/perl5.005_03.tar.gz.packed
 
-Created at Sun Apr 26 20:33:20 2009
+Created at Sat Jun 27 16:51:08 2009
 #########################################################################
 __UU__
 M'XL(`'3DO44``^W/,0J`,`Q`T1RE)Y"T-O4XXN"DB%2]OR(*NNC4[;_E#\F0
diff --git 
a/lib/CPANPLUS/t/dummy-CPAN/authors/id/EUXS/Foo-Bar-0.01.tar.gz.packed 
b/lib/CPANPLUS/t/dummy-CPAN/authors/id/EUXS/Foo-Bar-0.01.tar.gz.packed
index a677995..512aafc 100644
--- a/lib/CPANPLUS/t/dummy-CPAN/authors/id/EUXS/Foo-Bar-0.01.tar.gz.packed
+++ b/lib/CPANPLUS/t/dummy-CPAN/authors/id/EUXS/Foo-Bar-0.01.tar.gz.packed
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p 
lib/CPANPLUS/t/dummy-CPAN/authors/id/EUXS/Foo-Bar-0.01.tar.gz 
lib/CPANPLUS/t/dummy-CPAN/authors/id/EUXS/Foo-Bar-0.01.tar.gz.packed
 
-Created at Sun Apr 26 20:33:20 2009
+Created at Sat Jun 27 16:51:08 2009
 #########################################################################
 __UU__
 M'XL("`DY34("`T9O;RU"87(M,"XP,2YT87(`[5IK3]M(%,U7YE=<H%5``A.;
diff --git 
a/lib/CPANPLUS/t/dummy-CPAN/authors/id/MBNOXS/Foo-Bar-0.01.tar.gz.packed 
b/lib/CPANPLUS/t/dummy-CPAN/authors/id/MBNOXS/Foo-Bar-0.01.tar.gz.packed
index 73d05ba..a72e86e 100644
--- a/lib/CPANPLUS/t/dummy-CPAN/authors/id/MBNOXS/Foo-Bar-0.01.tar.gz.packed
+++ b/lib/CPANPLUS/t/dummy-CPAN/authors/id/MBNOXS/Foo-Bar-0.01.tar.gz.packed
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p 
lib/CPANPLUS/t/dummy-CPAN/authors/id/MBNOXS/Foo-Bar-0.01.tar.gz 
lib/CPANPLUS/t/dummy-CPAN/authors/id/MBNOXS/Foo-Bar-0.01.tar.gz.packed
 
-Created at Sun Apr 26 20:33:20 2009
+Created at Sat Jun 27 16:51:08 2009
 #########################################################################
 __UU__
 M'XL("-<X34(``T9O;RU"87(M,"XP,2YT87(`[9E;;]HP%,=Y]J<x+9...@-r
diff --git 
a/lib/CPANPLUS/t/dummy-CPAN/authors/id/MBXS/Foo-Bar-0.01.tar.gz.packed 
b/lib/CPANPLUS/t/dummy-CPAN/authors/id/MBXS/Foo-Bar-0.01.tar.gz.packed
index 33855e3..c2f66fa 100644
--- a/lib/CPANPLUS/t/dummy-CPAN/authors/id/MBXS/Foo-Bar-0.01.tar.gz.packed
+++ b/lib/CPANPLUS/t/dummy-CPAN/authors/id/MBXS/Foo-Bar-0.01.tar.gz.packed
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p 
lib/CPANPLUS/t/dummy-CPAN/authors/id/MBXS/Foo-Bar-0.01.tar.gz 
lib/CPANPLUS/t/dummy-CPAN/authors/id/MBXS/Foo-Bar-0.01.tar.gz.packed
 
-Created at Sun Apr 26 20:33:21 2009
+Created at Sat Jun 27 16:51:08 2009
 #########################################################################
 __UU__
 M'XL("-\X34(``T9O;RU"87(M,"XP,2YT87(`[5K_3QI)%/=7YZ]XU39H(BN[
diff --git a/lib/CPANPLUS/t/dummy-CPAN/modules/02packages.details.txt.gz.packed 
b/lib/CPANPLUS/t/dummy-CPAN/modules/02packages.details.txt.gz.packed
index e209dc1..a98f32d 100644
--- a/lib/CPANPLUS/t/dummy-CPAN/modules/02packages.details.txt.gz.packed
+++ b/lib/CPANPLUS/t/dummy-CPAN/modules/02packages.details.txt.gz.packed
@@ -10,16 +10,16 @@ To recreate it use the following command:
 
      uupacktool.pl -p 
lib/CPANPLUS/t/dummy-CPAN/modules/02packages.details.txt.gz 
lib/CPANPLUS/t/dummy-CPAN/modules/02packages.details.txt.gz.packed
 
-Created at Sun Apr 26 20:33:21 2009
+Created at Sat Jun 27 16:51:08 2009
 #########################################################################
 __UU__
-M'XL("-"H)4<``S`R<&%C:V%G97,N9&5T86EL<RYT>'0`G=-1;],p...@=_^*
-M>^`!I,;q4d63_$...@2t8z)$VQORXEMKD=B1?5DHOQY[9=JH*#!.EB+9Y\]W
-M5KPT+4IX"%'TJOFJMABX1E*F#9R^$:L_K1YS8$?4RSP?QY'WZ%O>N"Z?7\XN
-M\L[IH<60GU#>8&B\Z<DX&[7+0PI8U6&`6S=8#<:"-AX;<GX/+^Y--=#.^9`;
-MG;.Y:X?.AI^E]$^`"=RA#Q&>Q&G:L7>6T&K4V=)Y";.!7*<(-=PB-3OP;B!C
-M,4P.AT<(0;MFZ-"22N5Q=N4-12*K]NFTKM4FT*C2YI=W4/"I*%[!S1YF5GM4
-...@7]p:,WVM;*F4[%GMHI\-H\]4=I^)L[+DJU4H*SN=2I$PA7J"4P%O%<6"B$*
-M$*4LXCB'M^O/C"V=D[)27LI%+>7U!HY"<'&6OHOZ>I/'Y"SF9FF2D_)\^_T)
-ML*[^!*RK?P(N/AX3CT!:^PN1FCA-+.IG$%)NAIO_(8YOX!E$%7_.^$SD*>J(
-B.*1GOY/FHSY5QWT4OTKI?95<B/*+F#X0[`?@'LWVLP,`````
+M'XL("#=P,DH``S`R<&%C:V%G97,N9&5T86EL<RYT>'0`G=-1;],p...@=_^*
+M>^`!I,;Q4E5,?J(I+0+:;:)$V]ODQ;?6(K$C^[)0?CWVRK1146`[68IDGS_?
+M6?'"-"CA(431J?J;VF#@&DF9)G#Z3JSZLGS,@2U1)_-\&`;>H6]X[=I\=C$]
+MRUNG^P9#?D1YCZ'VIB/C;-0n...@58l!;eu...@+vgblr?d=o+hw54];YT-N
+M=,YFKNE;&WZ5TCT!1G"'/D1X%*=IRSY:0JM19POG)4Q[<JTBU'"+5&_!NYZ,
+MQ3#:'QXA!.WJOD5+*I7'V:4W%(FLW*73VD:;0(-*FU_?0<''h...@#-sn86nu1
+M!?[9H36;=\J:5L6>V3+RV2SV1&G[R2E;JD!9U>E4A81+U",8"_BD+!1"%"`F
+MLHCC+7Q8?65LX9R4I?)2SBLIK]9P$(*+D_2=5U?K/"9G,3=+DYR4YYL?3X!5
+m...@5?x7<'9^2#P":>T?1&KB.#&OGD%(N>YO7D(<WL`SB#+^F?&-R&/4`;%/
+...@s_xds09]k([[*'Z7TN.:<"$FUV+\0+"?<7X";+`#````
diff --git a/lib/CPANPLUS/t/dummy-CPAN/modules/03modlist.data.gz.packed 
b/lib/CPANPLUS/t/dummy-CPAN/modules/03modlist.data.gz.packed
index df1d600..4a36c7a 100644
--- a/lib/CPANPLUS/t/dummy-CPAN/modules/03modlist.data.gz.packed
+++ b/lib/CPANPLUS/t/dummy-CPAN/modules/03modlist.data.gz.packed
@@ -10,7 +10,7 @@ To recreate it use the following command:
 
      uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/modules/03modlist.data.gz 
lib/CPANPLUS/t/dummy-CPAN/modules/03modlist.data.gz.packed
 
-Created at Sun Apr 26 20:33:21 2009
+Created at Sat Jun 27 16:51:08 2009
 #########################################################################
 __UU__
 M'XL("#'FO$4``S`S;6]D;&ES="YD871A`%U3_6O;,!#].?HKCBXC"20A=<@&

--
Perl5 Master Repository

Reply via email to