summaryrefslogtreecommitdiff
path: root/write_buildcustomize.pl
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-12-04 05:46:40 -0800
committerFather Chrysostomos <sprout@cpan.org>2013-12-06 18:40:46 -0800
commita462003e1b0ecd74d52837c88aa79db4ff49fce8 (patch)
tree15f78d2e56b1acbc73ee821d17a177172bf9af8e /write_buildcustomize.pl
parent66ff7d34c2e2275f89445e904eb5979ada07ef9f (diff)
downloadperl-a462003e1b0ecd74d52837c88aa79db4ff49fce8.tar.gz
Do not clobber @INC completely in buildcustomize.pl
buildcustomize.pl (for miniperl) replaces @INC (usually qw(lib .)) with the whole list of build directories we need followed by qw(lib .). runperl from test.pl is such that this: runperl(switches => [ "-Irun/flib" ], ...) turns into: /path/to/perl.git/miniperl "-I../lib" -Irun/flib The end result is that -Irun/flib gets stripped out and clobbered, and switchM.t fails under minitest.
Diffstat (limited to 'write_buildcustomize.pl')
-rw-r--r--write_buildcustomize.pl8
1 files changed, 4 insertions, 4 deletions
diff --git a/write_buildcustomize.pl b/write_buildcustomize.pl
index 20ac532344..3f78264a7a 100644
--- a/write_buildcustomize.pl
+++ b/write_buildcustomize.pl
@@ -47,7 +47,7 @@ require File::Spec::Functions;
my $inc = join ",\n ",
map { "q\0$_\0" }
- (map {File::Spec::Functions::rel2abs($_)} @toolchain, 'lib'), '.';
+ (map {File::Spec::Functions::rel2abs($_)} @toolchain, 'lib');
open my $fh, '>', $file
or die "Can't open $file: $!";
@@ -65,9 +65,9 @@ print $fh <<"EOT" or $error = "Can't print to $file: $!";
# Any changes made here will be lost!
# We are miniperl, building extensions
-# Reset \@INC completely, adding the directories we need, and removing the
-# installed directories (which we don't need to read, and may confuse us)
-\@INC = ($inc);
+# Replace the first entry of \@INC ("lib") with the list of
+# directories we need.
+splice(\@INC, 0, 1, $inc);
EOT
if ($error) {