[Bps-public-commit] r18454 - in Shipwright/trunk: share/bin

jesse at bestpractical.com jesse at bestpractical.com
Wed Feb 18 21:26:45 EST 2009


Author: jesse
Date: Wed Feb 18 21:26:45 2009
New Revision: 18454

Modified:
   Shipwright/trunk/lib/Shipwright/Util/CleanINC.pm
   Shipwright/trunk/share/bin/shipwright-builder

Log:
make sure inc gets included _after_ the blib from the built directory - makes module::build happier


Modified: Shipwright/trunk/lib/Shipwright/Util/CleanINC.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Util/CleanINC.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Util/CleanINC.pm	Wed Feb 18 21:26:45 2009
@@ -4,23 +4,17 @@
 use Config;
 
 sub import {
-
     # It's expensive to do, but we need to find out what's in @INC now that
     # should be kept (because it was specified on the commandline with -I)
     # and what we should drop because it's baked into perl as a local lib
-    my %to_kill = map { $_ => 1} _default_inc();
-    my @inc_to_save;
-    for (@INC) {
-        next if exists $to_kill{$_};
-                push @inc_to_save, $_;
-            }
-    @INC = (
-        @inc_to_save,
-        '.',
-        $ENV{PERL5LIB} ? split( ':', $ENV{PERL5LIB} ) : (),
-        $Config::Config{privlibexp},
-        $Config::Config{archlibexp},
-    );
+    
+    my %skip_lib_path = map { $_ => 1 } _default_inc();
+    delete $skip_lib_path{'.'}; # . is important
+    my @explicit_libs = grep {!/inc$/}  split( /:/,($ENV{'PERL5LIB'} ||''));
+    my @inc_libs = grep {/inc$/}  split( /:/,($ENV{'PERL5LIB'} ||''));
+    # if the libs are explicitly specified, don't pull them from @INC
+    my @new_base_inc = grep { !$skip_lib_path{$_}++ } (  @explicit_libs, @INC, at inc_libs);
+    @INC = ( @new_base_inc, $Config::Config{privlibexp}, $Config::Config{archlibexp});
 }
 
 

Modified: Shipwright/trunk/share/bin/shipwright-builder
==============================================================================
--- Shipwright/trunk/share/bin/shipwright-builder	(original)
+++ Shipwright/trunk/share/bin/shipwright-builder	Wed Feb 18 21:26:45 2009
@@ -268,9 +268,9 @@
           catdir( $args{'install-base'}, 'lib' ) . ':' . $ENV{LD_LIBRARY_PATH};
         $ENV{PERL5LIB} = join(
             ':',
-            $inc_lib,
             catdir( 'blib','lib'),
             catdir('blib','arch'),
+            $inc_lib, #BLIB COMES FIRST TO PLEASE MODULE::BUILD
             catdir( $args{'install-base'}, 'lib', 'perl5',  $arch
             
             ),



More information about the Bps-public-commit mailing list