[Bps-public-commit] r18525 - in Shipwright/trunk/lib/Shipwright: Script

jesse at bestpractical.com jesse at bestpractical.com
Sun Feb 22 19:19:29 EST 2009


Author: jesse
Date: Sun Feb 22 19:19:29 2009
New Revision: 18525

Modified:
   Shipwright/trunk/lib/Shipwright/Script/Import.pm
   Shipwright/trunk/lib/Shipwright/Source/Base.pm
   Shipwright/trunk/lib/Shipwright/Source/CPAN.pm

Log:
Skip dists when we spec modules which are in core and dual lifed.

Modified: Shipwright/trunk/lib/Shipwright/Script/Import.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Script/Import.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Script/Import.pm	Sun Feb 22 19:19:29 2009
@@ -155,11 +155,11 @@
             $source = $shipwright->source->run(
                 copy => { '__require.yml' => $self->require_yml }, );
 
+            next unless $source; # if running the source returned undef, we should skip
+
             $version =
               Shipwright::Util::LoadFile( $shipwright->source->version_path );
-
             my ($name) = $source =~ m{.*/(.*)$};
-            print "importing $name: ";
             $imported{$name}++;
 
             my $base = $self->_parent_dir($source);

Modified: Shipwright/trunk/lib/Shipwright/Source/Base.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Source/Base.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Source/Base.pm	Sun Feb 22 19:19:29 2009
@@ -370,7 +370,13 @@
                                 _path   => undef,
                             );
                         }
-                        $s->run();
+                        unless ($s->run()) { 
+                            # if run returns false, we should skip trying to install it.
+                            # this lets us skip explicit dependencies that are actually part of the perl core
+                            #delete $require->{$type}{$module};
+                            next;
+
+                        }
                         chdir $cwd;
                     }
 

Modified: Shipwright/trunk/lib/Shipwright/Source/CPAN.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Source/CPAN.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Source/CPAN.pm	Sun Feb 22 19:19:29 2009
@@ -80,12 +80,14 @@
 sub run {
     my $self = shift;
     $self->log->info( "prepare to run source: " . $self->source );
-    if ( $self->_run ) {
+
+    my $result = $self->_run;
+    if ( $result == 1) { 
         my $compressed =
           Shipwright::Source::Compressed->new( %$self, _no_update_url => 1 );
         $compressed->run(@_);
     }
-    elsif ( $self->source =~ /\S/ ) {
+    elsif ( !$result &&  $self->source =~ /\S/ ) {
         my $error = q{invalid source: can't find '} . $self->source . q{'};
         if ( $self->version ) {
             $error .= ' version ' . $self->version;
@@ -93,6 +95,9 @@
        
         $error .= ' in your CPAN mirror(s)' . " [@{$CPAN::Config->{urllist}}].";
         confess $error;
+    } else {
+            $self->log->warn("Removing source ".$self->source);
+            return undef;
     }
 }
 
@@ -154,7 +159,8 @@
     my $name = CPAN::DistnameInfo->new( $distribution->{ID} )->dist;
 
     if ( $name eq 'perl' ) {
-        confess 'perl itself contains ' . $self->source . ', will not process';
+        $self->log->warn( 'perl itself contains ' . $self->source . ', will not process');
+        return -1;
     }
 
     Shipwright::Util->select('stdout');



More information about the Bps-public-commit mailing list