From: Jos I. Boumans Date: Sat, 27 Jun 2009 15:57:28 +0000 (+0200) Subject: Update CPANPLUS to 0.87_03 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a3de5d0b2ac804ed0e6a548da0ff3bd4e91331c7;p=p5sagit%2Fp5-mst-13.2.git Update CPANPLUS to 0.87_03 --- diff --git a/lib/CPANPLUS.pm b/lib/CPANPLUS.pm index 848fe39..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.87_02"; #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 c950cba..71953e7 100644 --- a/lib/CPANPLUS/Backend.pm +++ b/lib/CPANPLUS/Backend.pm @@ -14,7 +14,7 @@ use CPANPLUS::Backend::RV; use FileHandle; use File::Spec (); use File::Spec::Unix (); -use File::Basename (); +use File::Basename (); use Params::Check qw[check]; use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext'; @@ -497,6 +497,12 @@ sub parse_module { 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]+$/; diff --git a/lib/CPANPLUS/Internals.pm b/lib/CPANPLUS/Internals.pm index f0519fa..3bc0ea7 100644 --- a/lib/CPANPLUS/Internals.pm +++ b/lib/CPANPLUS/Internals.pm @@ -42,7 +42,7 @@ use vars qw[@ISA $VERSION]; CPANPLUS::Internals::Report ]; -$VERSION = "0.87_02"; +$VERSION = "0.87_03"; =pod diff --git a/lib/CPANPLUS/Internals/Constants.pm b/lib/CPANPLUS/Internals/Constants.pm index 05c5f1c..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 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/Shell/Default.pm b/lib/CPANPLUS/Shell/Default.pm index 47c094c..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.87_02"; + $VERSION = "0.87_03"; } load CPANPLUS::Shell; @@ -279,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 ### @@ -325,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'; @@ -349,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; @@ -368,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 ) @@ -378,6 +388,9 @@ sub dispatch_on_input { } } + ### outside the shell loop, we can return the actual return value; + return $rv if $self->noninteractive; + return; } @@ -489,6 +502,8 @@ sub __display_results { } else { $self->__print( loc("No results to display"), "\n" ); } + + return 1; } @@ -499,6 +514,8 @@ sub _quit { if defined $rc->{'logout'}; $self->__print( loc("Exiting CPANPLUS shell"), "\n" ); + + return 1; } ########################### @@ -575,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; } } @@ -599,7 +618,9 @@ sub _bang { eval $input; error( $@ ) if $@; $self->__print( "\n" ); - return; + + return if $@; + return 1; } sub _search_module { @@ -724,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'", @@ -736,7 +760,9 @@ sub _fetch { $self->__print( "\n" ); } $self->_pager_close; - + + return 1 if $rv; + return; } sub _shell { @@ -815,7 +841,7 @@ sub _distributions { $self->cache([undef,@rv]); $self->__display_results; - return; 1; + return 1; } sub _reload_indices { @@ -1602,7 +1628,6 @@ sub _reports { return 1; } - ### Load plugins { my @PluginModules; my %Dispatch = ( @@ -1616,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 7601864..73611e8 100644 --- a/lib/CPANPLUS/t/08_CPANPLUS-Backend.t +++ b/lib/CPANPLUS/t/08_CPANPLUS-Backend.t @@ -209,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/dummy-CPAN/authors/01mailrc.txt.gz.packed b/lib/CPANPLUS/t/dummy-CPAN/authors/01mailrc.txt.gz.packed index 00cc6b2..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 Sat Jun 13 13:18:28 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 efaa4db..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 Sat Jun 13 13:18:28 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 3bb117a..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 Sat Jun 13 13:18:28 2009 +Created at Sat Jun 27 16:51:08 2009 ######################################################################### __UU__ M'XL(`#P*BD<``^V:;6_B1A"`\WE_Q214(I$.QQ@;)*'0`G=-1;],P$`#@=_^* 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 593b721..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 Sat Jun 13 13:18:28 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=<@&