Update CPANPLUS to CPAN version 0.9118
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Tue, 14 Feb 2012 09:47:13 +0000 (09:47 +0000)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Tue, 14 Feb 2012 09:47:13 +0000 (09:47 +0000)
  [DELTA]

  Changes for 0.9118      Mon Feb 13 22:29:33 2012
  ================================================
  * Test reporting enhancements

Porting/Maintainers.pl
cpan/CPANPLUS/lib/CPANPLUS.pm
cpan/CPANPLUS/lib/CPANPLUS/Dist/MM.pm
cpan/CPANPLUS/lib/CPANPLUS/Internals.pm
cpan/CPANPLUS/lib/CPANPLUS/Internals/Constants/Report.pm
cpan/CPANPLUS/lib/CPANPLUS/Internals/Report.pm
cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm
pod/perldelta.pod

index 111489d..b883036 100755 (executable)
@@ -447,7 +447,7 @@ use File::Glob qw(:case);
 
     'CPANPLUS' => {
         'MAINTAINER'   => 'kane',
-        'DISTRIBUTION' => 'BINGOS/CPANPLUS-0.9116.tar.gz',
+        'DISTRIBUTION' => 'BINGOS/CPANPLUS-0.9118.tar.gz',
         'FILES'        => q[cpan/CPANPLUS],
         'EXCLUDED'     => [
             qr{^inc/},
index 995308c..3367aed 100644 (file)
@@ -13,7 +13,7 @@ BEGIN {
     use vars        qw( @EXPORT @ISA $VERSION );
     @EXPORT     =   qw( shell fetch get install );
     @ISA        =   qw( Exporter );
-    $VERSION = "0.9116";     #have to hardcode or cpan.org gets unhappy
+    $VERSION = "0.9118";     #have to hardcode or cpan.org gets unhappy
 }
 
 ### purely for backward compatibility, so we can call it from the commandline:
index 9121a95..cd42869 100644 (file)
@@ -604,6 +604,7 @@ sub create {
     }
 
     my $fail; my $prereq_fail; my $test_fail;
+    my $status = { };
     RUN: {
         ### this will set the directory back to the start
         ### dir, so we must chdir /again/
@@ -645,6 +646,10 @@ sub create {
                                 verbose => $verbose )
             ) {
                 error( loc( "MAKE failed: %1 %2", $!, $captured ) );
+                if ( $conf->get_conf('cpantest') ) {
+                  $status->{stage} = 'build';
+                  $status->{capture} = $captured;
+                }
                 $dist->status->make(0);
                 $fail++; last RUN;
             }
@@ -695,10 +700,20 @@ sub create {
                     msg( loc( "MAKE TEST passed: %1", $captured ), 0 );
                 }
 
+                if ( $conf->get_conf('cpantest') ) {
+                  $status->{stage} = 'test';
+                  $status->{capture} = $captured;
+                }
+
                 $dist->status->test(1);
             } else {
                 error( loc( "MAKE TEST failed: %1", $captured ), ( $run_verbose ? 0 : 1 ) );
 
+                if ( $conf->get_conf('cpantest') ) {
+                  $status->{stage} = 'test';
+                  $status->{capture} = $captured;
+                }
+
                 ### send out error report here? or do so at a higher level?
                 ### --higher level --kane.
                 $dist->status->test(0);
@@ -720,6 +735,7 @@ sub create {
         error( loc( "Could not chdir back to start dir '%1'", $orig ) );
     }
 
+    ### TODO: Add $stage to _send_report()
     ### send out test report?
     ### only do so if the failure is this module, not its prereq
     if( $conf->get_conf('cpantest') and not $prereq_fail) {
@@ -727,6 +743,7 @@ sub create {
             module  => $self,
             failed  => $test_fail || $fail,
             buffer  => CPANPLUS::Error->stack_as_string,
+            status  => $status,
             verbose => $verbose,
             force   => $force,
         ) or error(loc("Failed to send test report for '%1'",
index 9295e1b..a0fa443 100644 (file)
@@ -42,7 +42,7 @@ use vars qw[@ISA $VERSION];
             CPANPLUS::Internals::Report
         ];
 
-$VERSION = "0.9116";
+$VERSION = "0.9118";
 
 =pod
 
index 562a5ed..294de69 100644 (file)
@@ -200,6 +200,23 @@ $buffer
 .
                             };
 
+use constant REPORT_MESSAGE_PASS_HEADER
+                            => sub {
+                                my($stage, $buffer) = @_;
+                                return << ".";
+
+Thank you for uploading your work to CPAN.  Congratulations!
+All tests were successful.
+
+TEST RESULTS:
+
+Below is the error stack from stage '$stage':
+
+$buffer
+
+.
+                            };
+
 use constant REPORT_MISSING_PREREQS
                             => sub {
                                 my ($author,$email,@missing) = @_;
index f704bf0..24d4c62 100644 (file)
@@ -297,11 +297,12 @@ sub _send_report {
 
     ### check arguments ###
     my ($buffer, $failed, $mod, $verbose, $force, $address, $save,
-        $tests_skipped );
+        $tests_skipped, $status );
     my $tmpl = {
             module  => { required => 1, store => \$mod, allow => IS_MODOBJ },
             buffer  => { required => 1, store => \$buffer },
             failed  => { required => 1, store => \$failed },
+            status  => { default => {}, store => \$status, strict_type => 1 },
             address => { default  => CPAN_TESTERS_EMAIL, store => \$address },
             save    => { default  => 0, store => \$save },
             verbose => { default  => $conf->get_conf('verbose'),
@@ -471,8 +472,9 @@ sub _send_report {
         return 1 if $cp_conf =~  /\bmaketest_only\b/i
                     and ($stage !~ /\btest\b/);
 
+        my $capture = ( $status && defined $status->{capture} ? $status->{capture} : $buffer );
         ### the bit where we inform what went wrong
-        $message .= REPORT_MESSAGE_FAIL_HEADER->( $stage, $buffer );
+        $message .= REPORT_MESSAGE_FAIL_HEADER->( $stage, $capture );
 
         ### was it missing prereqs? ###
         if( my @missing = MISSING_PREREQS_LIST->($buffer) ) {
@@ -512,8 +514,22 @@ sub _send_report {
                         '[' . $_->tag . '] [' . $_->when . '] ' .
                         $_->message } ( CPANPLUS::Error->stack )[-1];
 
+        my $capture = ( $status && defined $status->{capture} ? $status->{capture} : $buffer );
         ### the bit where we inform what went wrong
-        $message .= REPORT_MESSAGE_FAIL_HEADER->( $stage, $buffer );
+        $message .= REPORT_MESSAGE_FAIL_HEADER->( $stage, $capture );
+
+        ### add a list of what modules have been loaded of your prereqs list
+        $message .= REPORT_LOADED_PREREQS->($mod);
+
+        ### add a list of versions of toolchain modules
+        $message .= REPORT_TOOLCHAIN_VERSIONS->($mod);
+
+        ### the footer
+        $message .= REPORT_MESSAGE_FOOTER->();
+
+    } elsif ( $grade eq GRADE_PASS and ( $status and defined $status->{capture} ) ) {
+        ### the bit where we inform what went right
+        $message .= REPORT_MESSAGE_PASS_HEADER->( $stage, $status->{capture} );
 
         ### add a list of what modules have been loaded of your prereqs list
         $message .= REPORT_LOADED_PREREQS->($mod);
index c06c1a6..6a53391 100644 (file)
@@ -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.9116";
+    $VERSION = "0.9118";
 }
 
 load CPANPLUS::Shell;
index 1242bf7..33b9af4 100644 (file)
@@ -313,6 +313,10 @@ L<CPAN::Meta::YAML> has been upgraded from version 0.005 to version 0.007.
 
 =item *
 
+L<CPANPLUS> has been upgraded from version 0.9116 to version 0.9118.
+
+=item *
+
 L<CPANPLUS::Dist::Build> has been upgraded from version 0.60 to version 0.62.
 
 =item *