[Bps-public-commit] r16878 - in Shipwright/trunk: lib/Shipwright/Source

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Nov 17 14:11:04 EST 2008


Author: sunnavy
Date: Mon Nov 17 14:11:03 2008
New Revision: 16878

Modified:
   Shipwright/trunk/   (props changed)
   Shipwright/trunk/lib/Shipwright/Source/CPAN.pm

Log:
 r17773 at sunnavys-mb:  sunnavy | 2008-11-18 03:10:47 +0800
 let shipwright be happy when he mets minicpan


Modified: Shipwright/trunk/lib/Shipwright/Source/CPAN.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Source/CPAN.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Source/CPAN.pm	Mon Nov 17 14:11:03 2008
@@ -43,9 +43,12 @@
     unless ( -f $config_file ) {
 
         # hack $CPAN::Config, mostly to make cpan stuff temporary
-        $CPAN::Config->{cpan_home}         = catdir($cpan_dir);
-        $CPAN::Config->{build_dir}         = catdir( $cpan_dir, 'build' );
-        $CPAN::Config->{histfile}          = catfile( $cpan_dir, 'histfile' );
+        $CPAN::Config->{cpan_home} = catdir($cpan_dir);
+        $CPAN::Config->{build_dir} = catdir( $cpan_dir, 'build' );
+        $CPAN::Config->{histfile}  = catfile( $cpan_dir, 'histfile' );
+
+        # be careful, if you use minicpan, then the source won't be copied to
+        # $CPAN::Config->{keep_source_where}
         $CPAN::Config->{keep_source_where} = catdir( $cpan_dir, 'sources' );
         $CPAN::Config->{prefs_dir}         = catdir( $cpan_dir, 'prefs' );
         $CPAN::Config->{prerequisites_policy} = 'follow';
@@ -72,7 +75,7 @@
           Shipwright::Source::Compressed->new( %$self, _no_update_url => 1 );
         $compressed->run(@_);
     }
-    elsif ($self->source =~ /\S/) {
+    elsif ( $self->source =~ /\S/ ) {
         confess 'invalid source: ' . $self->source;
     }
 }
@@ -128,7 +131,7 @@
                 $version = 'v' . $version;
             }
             $distribution->{ID} =~ s/$latest_version/$version/;
-            $source             =~ s/$latest_version/$version/;
+            $source =~ s/$latest_version/$version/;
         }
     }
 
@@ -138,16 +141,12 @@
         confess 'perl itself contains ' . $self->source . ', will not process';
     }
 
-    $distribution->get;
-
     Shipwright::Util->select('stdout');
 
     $self->name( 'cpan-' . $name );
     $self->_update_map( $self->source, 'cpan-' . $name );
 
-    $self->source(
-        catfile( $CPAN::Config->{keep_source_where}, 'authors', 'id', $source )
-    );
+    $self->source($distribution->get_file_onto_local_disk);
     return 1;
 }
 



More information about the Bps-public-commit mailing list