[Bps-public-commit] Shipwright branch, master, updated. 9d2bb3bd4a4c1c85a47cf9ee67239ec4fe22ef79

? sunnavy sunnavy at bestpractical.com
Tue Jun 8 00:53:10 EDT 2010


The branch, master has been updated
       via  9d2bb3bd4a4c1c85a47cf9ee67239ec4fe22ef79 (commit)
      from  d426a194be08c0e01c216f8994bdb81b03809a7d (commit)

Summary of changes:
 lib/Shipwright/Manual/ENV.pod |    2 ++
 lib/Shipwright/Source/CPAN.pm |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 9d2bb3bd4a4c1c85a47cf9ee67239ec4fe22ef79
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Jun 8 12:31:16 2010 +0800

    add SHIPWRIGHT_CPAN_MIRROR env

diff --git a/lib/Shipwright/Manual/ENV.pod b/lib/Shipwright/Manual/ENV.pod
index 420a6c8..9313ae8 100644
--- a/lib/Shipwright/Manual/ENV.pod
+++ b/lib/Shipwright/Manual/ENV.pod
@@ -53,6 +53,8 @@ F<svnadmin> command is expected to be in the same directory as F<svn>.
 
 =item SHIPWRIGHT_GIT - path of F<git> command, default value is F<git>.
 
+=item SHIPWRIGHT_CPAN_MIRROR - url of the cpan mirror
+
 =item SHIPWRIGHT_TEST_SVK
 
     test svk backend if this's true
diff --git a/lib/Shipwright/Source/CPAN.pm b/lib/Shipwright/Source/CPAN.pm
index 5bd9a1a..00f15e6 100644
--- a/lib/Shipwright/Source/CPAN.pm
+++ b/lib/Shipwright/Source/CPAN.pm
@@ -63,8 +63,13 @@ sub new {
         $CPAN::Config->{prefs_dir}         = catdir( $cpan_dir, 'prefs' );
         $CPAN::Config->{prerequisites_policy} = 'follow';
         unless ( $CPAN::Config->{urllist} && @{ $CPAN::Config->{urllist} } ) {
-            $CPAN::Config->{urllist} = ['http://search.cpan.org/CPAN'];
+            $CPAN::Config->{urllist} = [ 'http://search.cpan.org/CPAN' ];
         }
+
+        if ( $ENV{SHIPWRIGHT_CPAN_MIRROR} ) {
+            unshift @{$CPAN::Config->{urllist}}, $ENV{SHIPWRIGHT_CPAN_MIRROR};
+        }
+
         write_file( $config_file,
             Data::Dumper->Dump( [$CPAN::Config], ['$CPAN::Config'] ) );
 

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



More information about the Bps-public-commit mailing list