Update of /cvsroot/module-build/Module-Build/lib/Module/Build
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6398/lib/Module/Build
Modified Files:
Tag: release-0_26_branch
Base.pm
Log Message:
Just add necessary dirs to @INC in Build, don't set wholesale
Index: Base.pm
===================================================================
RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v
retrieving revision 1.340.2.5
retrieving revision 1.340.2.6
diff -C2 -d -r1.340.2.5 -r1.340.2.6
*** Base.pm 6 Dec 2004 22:52:51 -0000 1.340.2.5
--- Base.pm 12 Dec 2004 04:09:43 -0000 1.340.2.6
***************
*** 940,943 ****
--- 940,967 ----
sub _startperl { shift()->{config}{startperl} }
+ # Return any directories in @INC which are not in the default @INC for
+ # this Perl. For example, stuff passed in with -I or loaded with "use lib".
+ sub _added_to_INC {
+ my $self = shift;
+
+ my %seen;
+ $seen{$_}++ foreach $self->_default_INC;
+ return grep !$seen{$_}++, @INC;
+ }
+
+ # Determine the default @INC for this Perl
+ sub _default_INC {
+ my $self = shift;
+
+ local $ENV{PERL5LIB}; # this is not considered part of the default.
+
+ my $perl = $self->perl;
+
+ my @inc =`$perl -le "print for \@INC"`;
+ chomp @inc;
+
+ return @inc;
+ }
+
sub print_build_script {
my ($self, $fh) = @_;
***************
*** 948,952 ****
$q{base_dir} = Win32::GetShortPathName($q{base_dir}) if $^O eq 'MSWin32';
! my @myINC = @INC;
for (@myINC, values %q) {
$_ = File::Spec->canonpath( File::Spec->rel2abs($_) );
--- 972,976 ----
$q{base_dir} = Win32::GetShortPathName($q{base_dir}) if $^O eq 'MSWin32';
! my @myINC = $self->_added_to_INC;
for (@myINC, values %q) {
$_ = File::Spec->canonpath( File::Spec->rel2abs($_) );
***************
*** 973,977 ****
"Please re-run the Build.PL script here.\\n");
}
! \@INC =
(
$quoted_INC
--- 997,1001 ----
"Please re-run the Build.PL script here.\\n");
}
! unshift \@INC,
(
$quoted_INC
|