[Module-build-checkins] Module-Build/lib/Module/Build Base.pm,1.359,1.360
Status: Beta
Brought to you by:
kwilliams
From: Ken W. <kwi...@us...> - 2004-12-12 04:12:30
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6898/lib/Module/Build Modified Files: Base.pm Log Message: Integrate from branch Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.359 retrieving revision 1.360 diff -C2 -d -r1.359 -r1.360 *** Base.pm 7 Dec 2004 03:25:53 -0000 1.359 --- Base.pm 12 Dec 2004 04:12:19 -0000 1.360 *************** *** 964,967 **** --- 964,991 ---- 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) = @_; *************** *** 972,976 **** $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($_) ); --- 996,1000 ---- $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($_) ); *************** *** 997,1001 **** "Please re-run the Build.PL script here.\\n"); } ! \@INC = ( $quoted_INC --- 1021,1025 ---- "Please re-run the Build.PL script here.\\n"); } ! unshift \@INC, ( $quoted_INC |