diff options
author | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2011-03-20 00:37:18 +0000 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2011-03-20 00:40:44 +0000 |
commit | ee55d28a5c138dd40adab9902c2ffa649117f4ca (patch) | |
tree | eab6e2a56ddac7f15090b99e615226e4b8120233 /cpan | |
parent | 58f55cb38d788a9e7184836f9f728a46280356c8 (diff) | |
download | perl-ee55d28a5c138dd40adab9902c2ffa649117f4ca.tar.gz |
Update CPANPLUS to CPAN version 0.9103
[DELTA]
Changes for 0.9103 Sun Mar 20 00:38:05 2011
================================================
* Fixed the logic not sending NA reports when
'perl' is expressed as a prereq
Diffstat (limited to 'cpan')
-rw-r--r-- | cpan/CPANPLUS/lib/CPANPLUS.pm | 2 | ||||
-rw-r--r-- | cpan/CPANPLUS/lib/CPANPLUS/Internals.pm | 2 | ||||
-rw-r--r-- | cpan/CPANPLUS/lib/CPANPLUS/Internals/Report.pm | 79 | ||||
-rw-r--r-- | cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm | 2 |
4 files changed, 43 insertions, 42 deletions
diff --git a/cpan/CPANPLUS/lib/CPANPLUS.pm b/cpan/CPANPLUS/lib/CPANPLUS.pm index 79a48164a9..b012257265 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.9102"; #have to hardcode or cpan.org gets unhappy + $VERSION = "0.9103"; #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/Internals.pm b/cpan/CPANPLUS/lib/CPANPLUS/Internals.pm index cf23e920cc..4756421a4a 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.9102"; +$VERSION = "0.9103"; =pod diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Internals/Report.pm b/cpan/CPANPLUS/lib/CPANPLUS/Internals/Report.pm index a5f079b263..73a2d297e2 100644 --- a/cpan/CPANPLUS/lib/CPANPLUS/Internals/Report.pm +++ b/cpan/CPANPLUS/lib/CPANPLUS/Internals/Report.pm @@ -26,7 +26,7 @@ CPANPLUS::Internals::Report ### enable test reporting $cb->configure_object->set_conf( cpantest => 1 ); - + ### set custom mx host, shouldn't normally be needed $cb->configure_object->set_conf( cpantest_mx => 'smtp.example.com' ); @@ -104,7 +104,7 @@ otherwise. This function queries the CPAN testers database at I<http://testers.cpan.org/> for test results of specified module objects, -module names or distributions. +module names or distributions. The optional argument C<all_versions> controls whether all versions of a given distribution should be grabbed. It defaults to false @@ -185,7 +185,7 @@ sub _query_report { my $res = do { my $tempdir = File::Temp::tempdir(); my $where = $ff->fetch( to => $tempdir ); - + unless( $where ) { error( loc( "Fetching report for '%1' failed: %2", $url, $ff->error ) ); @@ -193,7 +193,7 @@ sub _query_report { } my $fh = OPEN_FILE->( $where ); - + do { local $/; <$fh> }; }; @@ -209,11 +209,11 @@ sub _query_report { my @rv; for my $href ( @$aref ) { - next unless $all or defined $href->{'distversion'} && + next unless $all or defined $href->{'distversion'} && $href->{'distversion'} eq $dist; $href->{'details'} = $details; - + ### backwards compatibility :( $href->{'dist'} ||= $href->{'distversion'}; $href->{'grade'} ||= $href->{'action'} || $href->{'status'}; @@ -296,7 +296,7 @@ sub _send_report { } ### check arguments ### - my ($buffer, $failed, $mod, $verbose, $force, $address, $save, + my ($buffer, $failed, $mod, $verbose, $force, $address, $save, $tests_skipped ); my $tmpl = { module => { required => 1, store => \$mod, allow => IS_MODOBJ }, @@ -308,7 +308,7 @@ sub _send_report { store => \$verbose }, force => { default => $conf->get_conf('force'), store => \$force }, - tests_skipped + tests_skipped => { default => 0, store => \$tests_skipped }, }; @@ -332,22 +332,22 @@ sub _send_report { my $grade; ### check if this is a platform specific module ### - ### if we failed the test, there may be reasons why + ### if we failed the test, there may be reasons why ### an 'NA' might have to be instead GRADE: { if ( $failed ) { - + ### XXX duplicated logic between this block ### and REPORTED_LOADED_PREREQS :( - + ### figure out if the prereqs are on CPAN at all ### -- if not, send NA grade ### Also, if our version of prereqs is too low, ### -- send NA grade. - ### This is to address bug: #25327: do not count + ### This is to address bug: #25327: do not count ### as FAIL modules where prereqs are not filled { my $prq = $mod->status->prereqs || {}; - + PREREQ: while( my($prq_name,$prq_ver) = each %$prq ) { # 'perl' listed as prereq @@ -362,12 +362,13 @@ sub _send_report { $grade = GRADE_NA; last GRADE; } + next PREREQ; } my $obj = $cb->module_tree( $prq_name ); - my $sub = CPANPLUS::Module->can( + my $sub = CPANPLUS::Module->can( 'module_is_supplied_with_perl_core' ); - + ### if we can't find the module and it's not supplied with core. ### this addresses: #32064: NA reports generated for failing ### tests where core prereqs are specified @@ -377,7 +378,7 @@ sub _send_report { ### http://rt.cpan.org/Ticket/Display.html?id=32155 if( !$obj and !defined $sub->( $prq_name ) ) { msg(loc( "Prerequisite '%1' for '%2' could not be obtained". - " from CPAN -- sending N/A grade", + " from CPAN -- sending N/A grade", $prq_name, $name ), $verbose ); $grade = GRADE_NA; @@ -388,10 +389,10 @@ sub _send_report { my $vcore = $sub->( $prq_name ); if ( $cb->_vcmp( $prq_ver, $vcore ) > 0 ) { msg(loc( "Version of core module '%1' ('%2') is too low for ". - "'%3' (needs '%4') -- sending N/A grade", - $prq_name, $vcore, + "'%3' (needs '%4') -- sending N/A grade", + $prq_name, $vcore, $name, $prq_ver ), $verbose ); - + $grade = GRADE_NA; last GRADE; } @@ -399,33 +400,33 @@ sub _send_report { if( $obj and $cb->_vcmp( $prq_ver, $obj->installed_version ) > 0 ) { msg(loc( "Installed version of '%1' ('%2') is too low for ". - "'%3' (needs '%4') -- sending N/A grade", - $prq_name, $obj->installed_version, + "'%3' (needs '%4') -- sending N/A grade", + $prq_name, $obj->installed_version, $name, $prq_ver ), $verbose ); - + $grade = GRADE_NA; last GRADE; - } + } } } - + unless( RELEVANT_TEST_RESULT->($mod) ) { msg(loc( "'%1' is a platform specific module, and the test results on". " your platform are not relevant --sending N/A grade.", $name), $verbose); - + $grade = GRADE_NA; - + } elsif ( UNSUPPORTED_OS->( $buffer ) ) { msg(loc( "'%1' is a platform specific module, and the test results on". " your platform are not relevant --sending N/A grade.", $name), $verbose); - + $grade = GRADE_NA; - - ### you dont have a high enough perl version? + + ### you dont have a high enough perl version? } elsif ( PERL_VERSION_TOO_LOW->( $buffer ) ) { msg(loc("'%1' requires a higher version of perl than your current ". "version -- sending N/A grade.", $name), $verbose); @@ -505,7 +506,7 @@ sub _send_report { } elsif ( $tests_skipped ) { $message .= REPORT_TESTS_SKIPPED->(); } elsif( $grade eq GRADE_NA) { - + ### the bit where we inform what went wrong $message .= REPORT_MESSAGE_FAIL_HEADER->( $stage, $buffer ); @@ -519,13 +520,13 @@ sub _send_report { ### reporter object ### my $reporter = do { my $args = $conf->get_conf('cpantest_reporter_args') || {}; - + unless( UNIVERSAL::isa( $args, 'HASH' ) ) { error(loc("'%1' must be a hashref, ignoring...", 'cpantest_reporter_args')); $args = {}; } - + Test::Reporter->new( grade => $grade, distribution => $dist, @@ -536,9 +537,9 @@ sub _send_report { %$args, ); }; - + ### set a custom mx, if requested - $reporter->mx( [ $conf->get_conf('cpantest_mx') ] ) + $reporter->mx( [ $conf->get_conf('cpantest_mx') ] ) if $conf->get_conf('cpantest_mx'); ### set the from address ### @@ -585,10 +586,10 @@ sub _send_report { ### XXX should we do an 'already sent' check? ### ### something broke :( ### - } + } else { my $status; - eval { + eval { $status = $reporter->send(); }; if ( $@ ) { @@ -620,7 +621,7 @@ sub _verify_missing_prereqs { check( $tmpl, \%hash ) or return; - + my %missing = map {$_ => 1} @$missing; my $conf = $self->configure_object; my $extract = $mod->status->extract; @@ -640,9 +641,9 @@ sub _verify_missing_prereqs { for my $file ( @search ) { if(-e $file and -r $file) { my $slurp = $self->_get_file_contents(file => $file); - my ($prereq) = + my ($prereq) = ($slurp =~ /'?(?:PREREQ_PM|requires)'?\s*=>\s*{(.*?)}/s); - my @prereq = + my @prereq = ($prereq =~ /'?([\w\:]+)'?\s*=>\s*'?\d[\d\.\-\_]*'?/sg); delete $missing{$_} for(@prereq); } diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm b/cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm index 4a7a9e535c..35c02aff2b 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.9102"; + $VERSION = "0.9103"; } load CPANPLUS::Shell; |