You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by st...@apache.org on 2003/11/05 10:45:22 UTC
cvs commit: modperl-2.0/lib/Apache Build.pm
stas 2003/11/05 01:45:22
Modified: lib/Apache Build.pm
Log:
fix once and for all Apache2 to put first devel libs (if in @INC), then
blib libs, and only then perl core libs. Untill now Apache2 was popping up
core libs with Apache2 dirs before lib, requiring re-order on the user
level
Revision Changes Path
1.149 +18 -0 modperl-2.0/lib/Apache/Build.pm
Index: Build.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -u -r1.148 -r1.149
--- Build.pm 9 Oct 2003 22:46:12 -0000 1.148
+++ Build.pm 5 Nov 2003 09:45:22 -0000 1.149
@@ -1519,6 +1519,24 @@
if (@dirs) {
unshift @INC, @dirs;
}
+
+ # now re-org the libs to have first devel libs, then blib libs,
+ # and only then perl core libs
+ use File::Basename qw(dirname);
+ my $project_root = $blib ? dirname(dirname($blib)) : '';
+ if ($project_root) {
+ my (@a, @b, @c);
+ for (@INC) {
+ if (m|^\Q$project_root\E|) {
+ m|blib| ? push @b, $_ : push @a, $_;
+ }
+ else {
+ push @c, $_;
+ }
+ }
+ @INC = (@a, @b, @c);
+ }
+
}
EOF