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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Jan 24 12:17:04 EST 2008


Author: sunnavy
Date: Thu Jan 24 12:17:04 2008
New Revision: 10471

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

Log:
we might not have CPAN::Config

Modified: bpsbuilder/Shipwright/lib/Shipwright/Backend.pm
==============================================================================
--- bpsbuilder/Shipwright/lib/Shipwright/Backend.pm	(original)
+++ bpsbuilder/Shipwright/lib/Shipwright/Backend.pm	Thu Jan 24 12:17:04 2008
@@ -140,8 +140,8 @@
 use Config;
 use Getopt::Long;
 use Cwd;
-use CPAN;
-use CPAN::Config;
+require CPAN;
+eval { require CPAN::Config } or warn "can't require CPAN::Config: $@";
 
 my $build_base = getcwd;
 

Modified: bpsbuilder/Shipwright/lib/Shipwright/Build.pm
==============================================================================
--- bpsbuilder/Shipwright/lib/Shipwright/Build.pm	(original)
+++ bpsbuilder/Shipwright/lib/Shipwright/Build.pm	Thu Jan 24 12:17:04 2008
@@ -18,12 +18,6 @@
 use File::Find qw/find/;
 use File::Slurp;
 
-use CPAN;
-use CPAN::Config;
-
-# we don't want any prereqs any more!
-$CPAN::Config->{prerequisites_policy} = 'ignore';
-
 =head2 new
 
 =cut
@@ -53,6 +47,14 @@
       . File::Spec->catfile( $self->install_base, 'sbin' ) . ':'
       . $ENV{PATH};
     $ENV{PERL_MM_USE_DEFAULT} = 1;
+
+    require CPAN;
+    eval { require CPAN::Config; }
+      or $self->log->warn("can't require CPAN::Config: $@");
+
+    # we don't want any prereqs any more!
+    $CPAN::Config->{prerequisites_policy} = 'ignore';
+
     return $self;
 }
 



More information about the Bps-public-commit mailing list