From: David Mitchell Date: Tue, 7 Jul 2009 16:06:43 +0000 (+0100) Subject: update to CPANPLUS 0.88 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8bc57f96f937d587b8b8d23c3de87da45f9efad0;p=p5sagit%2Fp5-mst-13.2.git update to CPANPLUS 0.88 --- diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index c08fd5d..fa2b907 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -449,7 +449,7 @@ package Maintainers; 'CPANPLUS' => { 'MAINTAINER' => 'kane', - 'DISTRIBUTION' => 'KANE/CPANPLUS-0.87_03.tar.gz', + 'DISTRIBUTION' => 'KANE/CPANPLUS-0.88.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 a31fa3b..8ef3595 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_03"; #have to hardcode or cpan.org gets unhappy + $VERSION = "0.88"; #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 71953e7..24336f4 100644 --- a/lib/CPANPLUS/Backend.pm +++ b/lib/CPANPLUS/Backend.pm @@ -1103,7 +1103,9 @@ $name - Snapshot of your installation at $now $head SYNOPSIS -perl -MCPANPLUS -e "install file://full/path/to/$name" +To install the modules from this snapshot, run: + + cpanp -i file://full/path/to/${name}.pm $head CONTENTS diff --git a/lib/CPANPLUS/Dist/MM.pm b/lib/CPANPLUS/Dist/MM.pm index 5baa24f..262c83b 100644 --- a/lib/CPANPLUS/Dist/MM.pm +++ b/lib/CPANPLUS/Dist/MM.pm @@ -680,7 +680,7 @@ sub create { if ( NO_TESTS_DEFINED->( $captured ) ) { msg( NO_TESTS_DEFINED->( $captured ), 0 ) } else { - msg( loc( "MAKE TEST passed: %2", $captured ), $verbose ); + msg( loc( "MAKE TEST passed: %1", $captured ), $verbose ); } $dist->status->test(1); diff --git a/lib/CPANPLUS/Hacking.pod b/lib/CPANPLUS/Hacking.pod index c89a403..1a28b9e 100644 --- a/lib/CPANPLUS/Hacking.pod +++ b/lib/CPANPLUS/Hacking.pod @@ -6,23 +6,16 @@ CPANPLUS::Hacking =head1 DESCRIPTION -This document attempts to describe how to easiest develop with the -CPANPLUS environment, how certain things work and why. +This document attempts to describe how to develop with the +CPANPLUS environment most easily, how certain things work and why. This is basically a quick-start guide to people who want to add features or patches to CPANPLUS. =head1 OBTAINING CPANPLUS -CPANPLUS offers snapshots from the stable and unstable branches. -After every patch to either of the branches, the snapshot is -automatically updated. - -You can find the stable branch here (which should be equal to the -CPAN release): L - -And the development branch here: -L +Checkout CPANPLUS from its Subversion repository at +L . =head1 INSTALLING CPANPLUS diff --git a/lib/CPANPLUS/Internals.pm b/lib/CPANPLUS/Internals.pm index 3bc0ea7..3df48c8 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_03"; +$VERSION = "0.88"; =pod diff --git a/lib/CPANPLUS/Internals/Constants.pm b/lib/CPANPLUS/Internals/Constants.pm index d891fbd..1d05c98 100644 --- a/lib/CPANPLUS/Internals/Constants.pm +++ b/lib/CPANPLUS/Internals/Constants.pm @@ -39,6 +39,7 @@ use constant CONFIG_BOXED => 'CPANPLUS::Config::Boxed'; use constant DEFAULT_SOURCE_ENGINE => 'CPANPLUS::Internals::Source::Memory'; +use constant TARGET_INIT => 'init'; use constant TARGET_CREATE => 'create'; use constant TARGET_PREPARE => 'prepare'; use constant TARGET_INSTALL => 'install'; diff --git a/lib/CPANPLUS/Module.pm b/lib/CPANPLUS/Module.pm index 3fc1462..5f7cec0 100644 --- a/lib/CPANPLUS/Module.pm +++ b/lib/CPANPLUS/Module.pm @@ -808,6 +808,9 @@ sub dist { DIST: { + ### just wanted the $dist object? + last DIST if $target eq TARGET_INIT; + ### first prepare the dist $dist->prepare( %$args ) or return; $self->status->prepared(1); @@ -872,7 +875,7 @@ sub test { =pod -=head2 $bool = $self->install([ target => 'prepare|create|install', format => FORMAT_TYPE, extractdir => DIRECTORY, fetchdir => DIRECTORY, prefer_bin => BOOL, force => BOOL, verbose => BOOL, ..... ]); +=head2 $bool = $self->install([ target => 'init|prepare|create|install', format => FORMAT_TYPE, extractdir => DIRECTORY, fetchdir => DIRECTORY, prefer_bin => BOOL, force => BOOL, verbose => BOOL, ..... ]); Installs the current module. This includes fetching it and extracting it, if this hasn't been done yet, as well as creating a distribution @@ -904,7 +907,7 @@ sub install { ### match this allow list with Dist->_resolve_prereqs target => { default => TARGET_INSTALL, store => \$target, allow => [TARGET_PREPARE, TARGET_CREATE, - TARGET_INSTALL] }, + TARGET_INSTALL, TARGET_INIT ] }, force => { default => $conf->get_conf('force'), }, verbose => { default => $conf->get_conf('verbose'), }, format => { default => $conf->get_conf('dist_type'), diff --git a/lib/CPANPLUS/Shell/Default.pm b/lib/CPANPLUS/Shell/Default.pm index 25d68ae..faeb6ff 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_03"; + $VERSION = "0.88"; } load CPANPLUS::Shell; diff --git a/lib/CPANPLUS/t/20_CPANPLUS-Dist-MM.t b/lib/CPANPLUS/t/20_CPANPLUS-Dist-MM.t index 241c6a2..a203c88 100644 --- a/lib/CPANPLUS/t/20_CPANPLUS-Dist-MM.t +++ b/lib/CPANPLUS/t/20_CPANPLUS-Dist-MM.t @@ -98,6 +98,13 @@ ok( $Mod, "Loaded object for: " . $InstMod->name ); ok( $Mod->fetch, "Fetching module to ".$Mod->status->fetch ); ok( $Mod->extract, "Extracting module to ".$Mod->status->extract ); +### test target => 'init' +{ my $dist = $Mod->dist( target => TARGET_INIT ); + ok( $dist, "Dist created with target => " . TARGET_INIT ); + ok( !$dist->status->prepared, + " Prepare was not run" ); +} + ok( $Mod->test, "Testing module" ); ok( $Mod->status->dist_cpan->status->test,