hotfix App::Cpan
David Golden [Mon, 21 Dec 2009 02:51:41 +0000 (21:51 -0500)]
Suppresses uninitialized warnings and NullLogger output.  Changes
have already been submitted to upstream repos.

cpan/CPAN/lib/App/Cpan.pm

index bfa32e9..f290cc8 100644 (file)
@@ -395,7 +395,7 @@ sub run
 package Local::Null::Logger;
 
 sub new { bless \ my $x, $_[0] }
-sub AUTOLOAD { shift; print "NullLogger: ", @_, $/ }
+sub AUTOLOAD { shift; print "NullLogger: ", @_, $/ if $ENV{CPAN_NULL_LOGGER} }
 sub DESTROY { 1 }
 }
 
@@ -492,7 +492,7 @@ sub _hook_into_CPANpm_report
        
        *CPAN::Shell::myprint = sub {
                my($self,$what) = @_;
-               $scalar .= $what;
+               $scalar .= $what if defined $what;
                $self->print_ornamented($what,
                        $CPAN::Config->{colorize_print}||'bold blue on_white',
                        );
@@ -500,7 +500,7 @@ sub _hook_into_CPANpm_report
 
        *CPAN::Shell::mywarn = sub {
                my($self,$what) = @_;
-               $scalar .= $what;   
+               $scalar .= $what if defined $what;
                $self->print_ornamented($what, 
                        $CPAN::Config->{colorize_warn}||'bold red on_white'
                        );