From 9abc3fabb7a778345c5a27cb8e6bfc4a934b4ca0 Mon Sep 17 00:00:00 2001 From: Chris 'BinGOs' Williams Date: Fri, 2 Jul 2010 15:05:53 +0100 Subject: [PATCH] Update CPANPLUS to CPAN version 0.9005 [DELTA] Changes for 0.9005 Tue Jun 29 22:42:25 2010 ================================================ * Corrected spelling mistakes in POD, pointed out by H.Merijn Brand * Amend SQLite source engine to set SYNCHRONOUS pragma to OFF * Make sure that Selfupdate checks if CPANPLUS::Dist::Build is installed or not and update it if it is. Spotted by Ilmari * Apply a patch from Peter Ludikovsky RT #55782 that adds indexes to Source::SQLite Changes for 0.9004 Sat May 8 22:21:04 2010 ================================================ * Applied a patch from Schwern RT #53133 "test failure occurs if the build directory is symlinked" * Explicitly set the location of cpanp-run-perl when under PERL_CORE in t/inc/conf.pl * Make sure that we find cpanp-run-perl in ../../utils when PERL_CORE * Apply a patch from Barbie [RT #56768], that fixes regex in RELEVANT_TEST_RESULT * Fixed a typo in the POD for cpan2dist, pointed out by Babar (Olivier Raginel) on irc. * Add a BEGIN {} block to cpanp-run-perl this resolves RT #55964 and RT #57106 Changes for 0.9003 Mon Mar 15 13:51:12 2010 ================================================ * Resolve warnings when using blead perl, reported by Apocalypse RT #55501 * Applied patch from Apocalypse RT #55541 that changes the behviour when a prereq on a core-only module is detected. We raise a warning now, but will proceed with the installation. This is how CPAN.pm handles it. * Removed one duff mirror and an out-of-date mirror from our default mirror list. Replaced with fast-sync mirrors. Changes for 0.9002 Fri Mar 12 13:11:00 2010 ================================================ * Added support for CPAN Testers 2.0 (David Golden) Changes for 0.9001 Thu Dec 24 10:21:11 2009 ================================================ * RT #52988 Regression in Internals::Utils, reported by CRAKRJACK * Fix a regression with dist_type not being propagated --- Porting/Maintainers.pl | 2 +- cpan/CPANPLUS/bin/cpan2dist | 2 +- cpan/CPANPLUS/lib/CPANPLUS.pm | 2 +- cpan/CPANPLUS/lib/CPANPLUS/Config.pm | 8 ++-- cpan/CPANPLUS/lib/CPANPLUS/Dist.pm | 8 ++-- cpan/CPANPLUS/lib/CPANPLUS/Error.pm | 4 +- cpan/CPANPLUS/lib/CPANPLUS/Internals.pm | 2 +- .../lib/CPANPLUS/Internals/Constants/Report.pm | 4 +- cpan/CPANPLUS/lib/CPANPLUS/Internals/Report.pm | 4 +- .../lib/CPANPLUS/Internals/Source/SQLite.pm | 52 +++++++++++++++++++--- cpan/CPANPLUS/lib/CPANPLUS/Internals/Utils.pm | 2 +- cpan/CPANPLUS/lib/CPANPLUS/Module.pm | 1 + cpan/CPANPLUS/lib/CPANPLUS/Selfupdate.pm | 5 ++- cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm | 3 +- cpan/CPANPLUS/t/19_CPANPLUS-Dist.t | 15 ++++--- cpan/CPANPLUS/t/40_CPANPLUS-Internals-Report.t | 2 +- cpan/CPANPLUS/t/inc/conf.pl | 4 +- 17 files changed, 85 insertions(+), 35 deletions(-) diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 54998d0..42b4010 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -395,7 +395,7 @@ use File::Glob qw(:case); 'CPANPLUS' => { 'MAINTAINER' => 'kane', - 'DISTRIBUTION' => 'BINGOS/CPANPLUS-0.90.tar.gz', + 'DISTRIBUTION' => 'BINGOS/CPANPLUS-0.9005.tar.gz', 'FILES' => q[cpan/CPANPLUS], 'EXCLUDED' => [ qr{^inc/}, qr{^t/dummy-.*\.hidden$}, diff --git a/cpan/CPANPLUS/bin/cpan2dist b/cpan/CPANPLUS/bin/cpan2dist index 5ba4556..2fcbdf7 100644 --- a/cpan/CPANPLUS/bin/cpan2dist +++ b/cpan/CPANPLUS/bin/cpan2dist @@ -624,7 +624,7 @@ sub _default_ban_list { ^GD$ # Needs c libaries ^Berk.*DB # DB packages require specific options & linking - ^DBD:: # DBD drives require database files/headers + ^DBD:: # DBD drivers require database files/headers ^XML:: # XML modules usually require expat libraries Apache # These usually require apache libraries SSL # These usually require SSL certificates & libs diff --git a/cpan/CPANPLUS/lib/CPANPLUS.pm b/cpan/CPANPLUS/lib/CPANPLUS.pm index b61771b..192e5c9 100644 --- a/cpan/CPANPLUS/lib/CPANPLUS.pm +++ b/cpan/CPANPLUS/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.90"; #have to hardcode or cpan.org gets unhappy + $VERSION = "0.9005"; #have to hardcode or cpan.org gets unhappy } ### purely for backward compatibility, so we can call it from the commandline: diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Config.pm b/cpan/CPANPLUS/lib/CPANPLUS/Config.pm index 740ef1e..06c23d2 100644 --- a/cpan/CPANPLUS/lib/CPANPLUS/Config.pm +++ b/cpan/CPANPLUS/lib/CPANPLUS/Config.pm @@ -125,13 +125,13 @@ An example entry would like this: }, { 'scheme' => 'ftp', - 'path' => '/pub/CPAN/', - 'host' => 'ftp.nl.uu.net' + 'path' => '/', + 'host' => 'cpan.hexten.net' }, { 'scheme' => 'ftp', - 'path' => '/pub/CPAN/', - 'host' => 'cpan.valueclick.com' + 'path' => '/CPAN/', + 'host' => 'cpan.cpantesters.org' }, { 'scheme' => 'ftp', diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Dist.pm b/cpan/CPANPLUS/lib/CPANPLUS/Dist.pm index 551b8ec..dafb1ef 100644 --- a/cpan/CPANPLUS/lib/CPANPLUS/Dist.pm +++ b/cpan/CPANPLUS/lib/CPANPLUS/Dist.pm @@ -611,10 +611,10 @@ sub _resolve_prereqs { ### part of core? if( $modobj->package_is_perl_core ) { error(loc("Prerequisite '%1' is perl-core (%2) -- not ". - "installing that. Aborting install", + "installing that. -- Note that the overall ". + "install may fail due to this.", $modobj->module, $modobj->package ) ); - $flag++; - last; + next; } ### circular dependency code ### @@ -672,7 +672,7 @@ sub _resolve_prereqs { keys %$prereqs; ### chdir back to where we started - chdir $original_wd; + $cb->_chdir( dir => $original_wd ); return 1 unless $flag; return; diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Error.pm b/cpan/CPANPLUS/lib/CPANPLUS/Error.pm index 38710a8..42e26aa 100644 --- a/cpan/CPANPLUS/lib/CPANPLUS/Error.pm +++ b/cpan/CPANPLUS/lib/CPANPLUS/Error.pm @@ -100,7 +100,9 @@ BEGIN { } sub flush { - return reverse $log->flush; + my @foo = $log->flush; + return unless @foo; + return reverse @foo; } sub stack { diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Internals.pm b/cpan/CPANPLUS/lib/CPANPLUS/Internals.pm index fedcb67..df66b8d 100644 --- a/cpan/CPANPLUS/lib/CPANPLUS/Internals.pm +++ b/cpan/CPANPLUS/lib/CPANPLUS/Internals.pm @@ -42,7 +42,7 @@ use vars qw[@ISA $VERSION]; CPANPLUS::Internals::Report ]; -$VERSION = "0.90"; +$VERSION = "0.9005"; =pod diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Internals/Constants/Report.pm b/cpan/CPANPLUS/lib/CPANPLUS/Internals/Constants/Report.pm index 59a41a6..abdb3c9 100644 --- a/cpan/CPANPLUS/lib/CPANPLUS/Internals/Constants/Report.pm +++ b/cpan/CPANPLUS/lib/CPANPLUS/Internals/Constants/Report.pm @@ -80,10 +80,10 @@ use constant RELEVANT_TEST_RESULT my $name = $mod->module; my $specific; for my $platform (keys %OS) { - if( $name =~ /\b$platform\b/i ) { + if( $name =~ /^$platform\b/i ) { # beware the Mac != MAC next if($platform eq 'Mac' && - $name !~ /\b$platform\b/); + $name !~ /^$platform\b/); $specific++; return 1 if $^O =~ /^(?:$OS{$platform})$/ diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Internals/Report.pm b/cpan/CPANPLUS/lib/CPANPLUS/Internals/Report.pm index 774c6b9..24e49d4 100644 --- a/cpan/CPANPLUS/lib/CPANPLUS/Internals/Report.pm +++ b/cpan/CPANPLUS/lib/CPANPLUS/Internals/Report.pm @@ -63,7 +63,7 @@ otherwise. my $send_list = { %$query_list, - 'Test::Reporter' => '1.34', + 'Test::Reporter' => '1.54', }; sub _have_query_report_modules { @@ -317,6 +317,7 @@ sub _send_report { my $name = $mod->module; my $dist = $mod->package_name . '-' . $mod->package_version; my $author = $mod->author->author; + my $distfile= $mod->author->cpanid . "/" . $mod->package; my $email = $mod->author->email || CPAN_MAIL_ACCOUNT->( $author ); my $cp_conf = $conf->get_conf('cpantest') || ''; my $int_ver = $CPANPLUS::Internals::VERSION; @@ -512,6 +513,7 @@ sub _send_report { Test::Reporter->new( grade => $grade, distribution => $dist, + distfile => $distfile, via => "CPANPLUS $int_ver", timeout => $conf->get_conf('timeout') || 60, debug => $conf->get_conf('debug'), diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Internals/Source/SQLite.pm b/cpan/CPANPLUS/lib/CPANPLUS/Internals/Source/SQLite.pm index a0ddf49..5061ad3 100644 --- a/cpan/CPANPLUS/lib/CPANPLUS/Internals/Source/SQLite.pm +++ b/cpan/CPANPLUS/lib/CPANPLUS/Internals/Source/SQLite.pm @@ -51,6 +51,7 @@ CPANPLUS::Internals::Source::SQLite - SQLite implementation { AutoCommit => 1 } ); #$Dbh->dbh->trace(1); + $Dbh->query(qq{PRAGMA synchronous = OFF}); return $Dbh; }; @@ -118,7 +119,7 @@ CPANPLUS::Internals::Source::SQLite - SQLite implementation sub _standard_trees_completed { return $used_old_copy } sub _custom_trees_completed { return } ### finish transaction - sub _finalize_trees { $_[0]->__sqlite_dbh->query('COMMIT'); return 1 } + sub _finalize_trees { $_[0]->__sqlite_dbh->commit; return 1 } ### saves current memory state, but not implemented in sqlite sub _save_state { @@ -155,8 +156,8 @@ CPANPLUS::Internals::Source::SQLite - SQLite implementation ### keep counting how many we inserted unless( ++$txn_count % TXN_COMMIT ) { #warn "Committing transaction $txn_count"; - $dbh->query('COMMIT') or error( $dbh->error ); # commit previous transaction - $dbh->query('BEGIN') or error( $dbh->error ); # and start a new one + $dbh->commit or error( $dbh->error ); # commit previous transaction + $dbh->begin_work or error( $dbh->error ); # and start a new one } $dbh->query( @@ -201,8 +202,8 @@ CPANPLUS::Internals::Source::SQLite - SQLite implementation ### keep counting how many we inserted unless( ++$txn_count % TXN_COMMIT ) { #warn "Committing transaction $txn_count"; - $dbh->query('COMMIT') or error( $dbh->error ); # commit previous transaction - $dbh->query('BEGIN') or error( $dbh->error ); # and start a new one + $dbh->commit or error( $dbh->error ); # commit previous transaction + $dbh->begin_work or error( $dbh->error ); # and start a new one } $dbh->query( @@ -319,7 +320,46 @@ sub __sqlite_create_db { error( $dbh->error ); return; }; - + + $dbh->query( qq[ + /* the module index */ + CREATE INDEX IX_module_module ON module ( + module + ); + + \n] + + ) or do { + error( $dbh->error ); + return; + }; + + $dbh->query( qq[ + /* the version index */ + CREATE INDEX IX_module_version ON module ( + version + ); + + \n] + + ) or do { + error( $dbh->error ); + return; + }; + + $dbh->query( qq[ + /* the module-version index */ + CREATE INDEX IX_module_module_version ON module ( + module, version + ); + + \n] + + ) or do { + error( $dbh->error ); + return; + }; + return 1; } diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Internals/Utils.pm b/cpan/CPANPLUS/lib/CPANPLUS/Internals/Utils.pm index 27d2abc..8475c36 100644 --- a/cpan/CPANPLUS/lib/CPANPLUS/Internals/Utils.pm +++ b/cpan/CPANPLUS/lib/CPANPLUS/Internals/Utils.pm @@ -5,7 +5,7 @@ use strict; use CPANPLUS::Error; use CPANPLUS::Internals::Constants; -use Cwd qw[chdir]; +use Cwd qw[chdir cwd]; use File::Copy; use Params::Check qw[check]; use Module::Load::Conditional qw[can_load]; diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Module.pm b/cpan/CPANPLUS/lib/CPANPLUS/Module.pm index 9e4b67e..2122c6d 100644 --- a/cpan/CPANPLUS/lib/CPANPLUS/Module.pm +++ b/cpan/CPANPLUS/lib/CPANPLUS/Module.pm @@ -1001,6 +1001,7 @@ sub install { $self->extract( %$params ) or return; } + $args->{'prereq_format'} = $format if $format; $format ||= $self->status->installer_type; unless( $format ) { diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Selfupdate.pm b/cpan/CPANPLUS/lib/CPANPLUS/Selfupdate.pm index 48f918c..0118e43 100644 --- a/cpan/CPANPLUS/lib/CPANPLUS/Selfupdate.pm +++ b/cpan/CPANPLUS/lib/CPANPLUS/Selfupdate.pm @@ -4,6 +4,7 @@ use strict; use Params::Check qw[check]; use IPC::Cmd qw[can_run]; use CPANPLUS::Error qw[error msg]; +use Module::Load::Conditional qw[check_install]; use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext'; use CPANPLUS::Internals::Constants; @@ -46,7 +47,7 @@ CPANPLUS::Selfupdate 'Locale::Maketext::Simple' => '0.01', 'Log::Message' => '0.01', 'Module::Load' => '0.10', - 'Module::Load::Conditional' => '0.31_01', # returns dir for loaded + 'Module::Load::Conditional' => '0.38', # returns dir for loaded # modules 'version' => '0.73', # needed for M::L::C # addresses #24630 and @@ -67,6 +68,8 @@ CPANPLUS::Selfupdate 'Module::Loaded' => '0.01', 'Parse::CPAN::Meta' => '0.02', # config_requires support 'ExtUtils::Install' => '1.42', # uninstall outside @INC + ( check_install( module => 'CPANPLUS::Dist::Build' ) + ? ( 'CPANPLUS::Dist::Build' => '0.24' ) : () ), }, features => { diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm b/cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm index a9d5142..f59d711 100644 --- a/cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm +++ b/cpan/CPANPLUS/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.90"; + $VERSION = "0.9005"; } load CPANPLUS::Shell; @@ -1222,6 +1222,7 @@ sub _set_conf { my ($type,$key,$value) = $input =~ m/(\w+)\s*(\w*)\s*(.*?)$/; $value =~ s/\s+$//g if $value; + $type = '' unless defined $type; $type = lc $type; if( $type eq 'reconfigure' ) { diff --git a/cpan/CPANPLUS/t/19_CPANPLUS-Dist.t b/cpan/CPANPLUS/t/19_CPANPLUS-Dist.t index cb0cd33..ee7b564 100644 --- a/cpan/CPANPLUS/t/19_CPANPLUS-Dist.t +++ b/cpan/CPANPLUS/t/19_CPANPLUS-Dist.t @@ -199,13 +199,6 @@ ok( $Mod, "Got module object" ); " Dist installation failed recorded ok" ) }, ], - "Set dependency to be perl-core" => [ - sub { $cb->module_tree( $ModPrereq )->package( - 'perl-5.8.1.tar.gz' ); 'install' }, - sub { like( CPANPLUS::Error->stack_as_string, - qr/Prerequisite '$ModPrereq' is perl-core/s, - " Dist installation failed recorded ok" ) }, - ], 'Simple ignore' => [ sub { 'ignore' }, sub { ok( !$_[0]->status->prepared, @@ -254,6 +247,14 @@ ok( $Mod, "Got module object" ); " Module status says installed" ) }, ], + "Set dependency to be perl-core" => [ + sub { $cb->module_tree( $ModPrereq )->package( + 'perl-5.8.1.tar.gz' ); 'install' }, + sub { like( CPANPLUS::Error->stack_as_string, + qr/Prerequisite '$ModPrereq' is perl-core/s, + " Dist installation failed recorded ok" ) }, + ], + 'Install from conf' => [ sub { $conf->set_conf(prereqs => PREREQ_INSTALL); '' }, sub { ok( $_[0]->status->prepared, diff --git a/cpan/CPANPLUS/t/40_CPANPLUS-Internals-Report.t b/cpan/CPANPLUS/t/40_CPANPLUS-Internals-Report.t index ecce8a5..066d5be 100644 --- a/cpan/CPANPLUS/t/40_CPANPLUS-Internals-Report.t +++ b/cpan/CPANPLUS/t/40_CPANPLUS-Internals-Report.t @@ -180,7 +180,7 @@ my $map = { ### test non-relevant tests ### my $cp = $Mod->clone; - $cp->module( $Mod->module . '::' . ($^O eq 'beos' ? 'MSDOS' : 'Be') ); + $cp->module( ($^O eq 'beos' ? 'MSDOS' : 'Be') . '::' . $cp->module ); ok(!RELEVANT_TEST_RESULT->($cp),"Test is irrelevant"); } diff --git a/cpan/CPANPLUS/t/inc/conf.pl b/cpan/CPANPLUS/t/inc/conf.pl index ca64731..44b358c 100644 --- a/cpan/CPANPLUS/t/inc/conf.pl +++ b/cpan/CPANPLUS/t/inc/conf.pl @@ -31,11 +31,11 @@ BEGIN { ### and friends get picked up $old_env_path = $ENV{PATH}; if ( $ENV{PERL_CORE} ) { - $ENV{'PATH'} = join $Config{'path_sep'}, + $ENV{'PATH'} = join $Config{'path_sep'}, grep { defined } "$FindBin::Bin/../../../utils", $ENV{'PATH'}; } else { - $ENV{'PATH'} = join $Config{'path_sep'}, + $ENV{'PATH'} = join $Config{'path_sep'}, grep { defined } "$FindBin::Bin/../bin", $ENV{'PATH'}; } -- 2.7.4