[Bps-public-commit] r10654 - bpsbuilder/Shipwright/lib/Shipwright

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Feb 1 08:33:38 EST 2008


Author: sunnavy
Date: Fri Feb  1 08:32:49 2008
New Revision: 10654

Modified:
   bpsbuilder/Shipwright/lib/Shipwright/Backend.pm

Log:
require CPAN only when install

Modified: bpsbuilder/Shipwright/lib/Shipwright/Backend.pm
==============================================================================
--- bpsbuilder/Shipwright/lib/Shipwright/Backend.pm	(original)
+++ bpsbuilder/Shipwright/lib/Shipwright/Backend.pm	Fri Feb  1 08:32:49 2008
@@ -187,16 +187,9 @@
 use Config;
 use Getopt::Long;
 use Cwd;
-require CPAN;
-eval { require CPAN::Config } or warn "can't require CPAN::Config: $@";
 
 my $build_base = getcwd;
 
-# we don't want any prereqs any more!
-{
-    no warnings 'once';
-    $CPAN::Config->{prerequisites_policy} = 'ignore';
-}
 
 my %args;
 GetOptions(
@@ -277,10 +270,18 @@
     }
 }
 else {
-
     # for install
     open $log, '>', 'build.log' or die $!;
 
+    require CPAN;
+    eval { require CPAN::Config } or warn "can't require CPAN::Config: $@";
+
+    # we don't want any prereqs any more!
+    {
+        no warnings 'once';
+        $CPAN::Config->{prerequisites_policy} = 'ignore';
+    }
+
     my ($project_name) = $build_base =~ /([-\w]+)$/;
     unless ( $args{'install-base'} ) {
         my $dir = tempdir( $project_name . '-XXXXXX', DIR => '/tmp' );



More information about the Bps-public-commit mailing list