[Bps-public-commit] r18423 - Shipwright/trunk/share/bin

jesse at bestpractical.com jesse at bestpractical.com
Mon Feb 16 19:10:30 EST 2009


Author: jesse
Date: Mon Feb 16 19:10:30 2009
New Revision: 18423

Modified:
   Shipwright/trunk/share/bin/shipwright-builder

Log:
* Bludgeon the build PERL environment to use only a minimal set of lib paths matchign what we've installed, what we're installing and our inc.
* LIE and say we're CPANPLUS so ExtUtils::AutoInstall doesn't freak out

Modified: Shipwright/trunk/share/bin/shipwright-builder
==============================================================================
--- Shipwright/trunk/share/bin/shipwright-builder	(original)
+++ Shipwright/trunk/share/bin/shipwright-builder	Mon Feb 16 19:10:30 2009
@@ -254,17 +254,31 @@
     }
 
     {
+
+                my $arch_command = ($args{perl} || $^X)." -MConfig -e 'print \$Config{archname}'";
+                my $arch = `$arch_command`;
+
         no warnings 'uninitialized';
+        # this dirty hack means that ExtUtils::AutoInstall won't try to recurse and run cpan
+        $ENV{'PERL5_CPANPLUS_IS_RUNNING'}= 1;
         $ENV{DYLD_LIBRARY_PATH} =
           catdir( $args{'install-base'}, 'lib' ) . ':'
           . $ENV{DYLD_LIBRARY_PATH};
         $ENV{LD_LIBRARY_PATH} =
           catdir( $args{'install-base'}, 'lib' ) . ':' . $ENV{LD_LIBRARY_PATH};
-        $ENV{PERL5LIB} =
-            catdir( $args{'install-base'}, 'lib', 'perl5', 'site_perl' ) . ':'
-          . catdir( $args{'install-base'}, 'lib', 'perl5' ) . ':'
-          . $inc_lib . ':'
-          . $ENV{PERL5LIB};
+        $ENV{PERL5LIB} = join(
+            ':',
+            $inc_lib,
+            catdir( 'blib','lib'),
+            catdir('blib','arch'),
+            catdir( $args{'install-base'}, 'lib', 'perl5',  $arch
+            
+            ),
+            catdir( $args{'install-base'}, 'lib', 'perl5', 'site_perl' ),
+            catdir( $args{'install-base'}, 'lib', 'perl5' ),
+            $ENV{PERL5LIB}
+        );
+
         $ENV{PATH} =
             catdir( $args{'install-base'}, 'bin' ) . ':'
           . catdir( $args{'install-base'}, 'sbin' ) . ':'
@@ -356,8 +370,9 @@
 
     if ( -e catfile( '..', '..', 'scripts', $dir, 'build.pl' ) ) {
         print $log "found build.pl for $dir, will install $dir using that\n";
-        my $cmd = join ' ', $args{perl} || $^X,
-           '-MShipwright::Util::CleanINC',
+        my $cmd = join ' ', 
+           'PERL5OPT=-MShipwright::Util::CleanINC',
+            $args{perl} || $^X,
           catfile( '..', '..', 'scripts', $dir, 'build.pl' ),
           '--install-base' => $args{'install-base'},
           '--flags'        => join( ',', keys %{ $args{flags} } ),
@@ -500,10 +515,9 @@
     }
 
     my $perl_archname = `$perl -MConfig -e 'print \$Config{archname}'`;
-    $text =~ s/%%PERL%%/$perl -MShipwright::Util::CleanINC/g;
-    $text =~ s/%%PERL_ARCHNAME%%/$perl_archname/g;
+    $text =~ s/%%PERL%%/PERL5OPT="-I$inc_lib -MShipwright::Util::CleanINC" $perl/g;
     $text =~ s/%%PERL_ARCHNAME%%/$perl_archname/g;
-    $text =~ s/%%MAKE%%/$args{make}/g;
+    $text =~ s/%%MAKE%%/PERL5OPT="-I$inc_lib -MShipwright::Util::CleanINC" $args{make}/g;
 
     return $text;
 }



More information about the Bps-public-commit mailing list