[Bps-public-commit] Shipwright branch, master, updated. 5bacc5494d50074fffd65769cc64ea42af6d3705

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Aug 6 04:28:29 EDT 2009


The branch, master has been updated
       via  5bacc5494d50074fffd65769cc64ea42af6d3705 (commit)
      from  536a975a2ef85bc98b1880f162c3d71cf15f1102 (commit)

Summary of changes:
 lib/Shipwright/Source/CPAN.pm |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 5bacc5494d50074fffd65769cc64ea42af6d3705
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Aug 6 16:28:19 2009 +0800

    don't download cpan dists too if they exist already

diff --git a/lib/Shipwright/Source/CPAN.pm b/lib/Shipwright/Source/CPAN.pm
index 68272b8..fba1242 100644
--- a/lib/Shipwright/Source/CPAN.pm
+++ b/lib/Shipwright/Source/CPAN.pm
@@ -173,8 +173,15 @@ sub _run {
     $self->name( 'cpan-' . $name );
     $self->_update_map( $self->source, 'cpan-' . $name );
 
-    $self->source($distribution->get_file_onto_local_disk);
+    my ($file) = catfile( $CPAN::Config->{keep_source_where},
+        "authors", "id", split /\//, $distribution->id );
 
+    if ( -e $file && -s $file ) {
+        $self->source($file);
+    }
+    else {
+        $self->source($distribution->get_file_onto_local_disk);
+    }
     return 1;
 }
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list