If PERL5LIB is set to the libdir when building ikiwiki, calculate and hardcode a...
authorJoey Hess <joey@kodama.kitenet.net>
Wed, 14 May 2008 06:42:01 +0000 (02:42 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Wed, 14 May 2008 06:42:01 +0000 (02:42 -0400)
debian/changelog
pm_filter

index ceb113aa14f221910c072d89f0bc67af5d741195..e387af09561bdbd1fa7731addceb9610c9cc63c5 100644 (file)
@@ -1,6 +1,10 @@
 ikiwiki (2.47) UNRELEASED; urgency=low
 
   * mdwn: Add a multimarkdown setup file option.
+  * If PERL5LIB is set to the libdir when building ikiwiki, calculate and 
+    hardcode a proper 'use lib' statement anyway. This fixes a gotcha,
+    since PERL5LIB won't work once ikiwiki is running via a wrapper or as
+    a cgi.
 
  -- Joey Hess <joeyh@debian.org>  Tue, 13 May 2008 12:30:18 -0400
 
index 98cb5bd9ef930f5bb55d4efd4b27ea015fa987ae..5ee5a1b9890d8b2b60ae67686aa1f841a7531d01 100755 (executable)
--- a/pm_filter
+++ b/pm_filter
@@ -13,7 +13,12 @@ elsif (/VERSION_AUTOREPLACE/) {
        $_=qq{our \$version="$ver";};
 }
 elsif (/^use lib/) {
-       if (grep { $_ eq $libdir } @INC) {
+       # The idea here is to figure out if the libdir the Makefile.PL
+       # was configure to use is in perl's normal search path.
+       # If not, hard code it into ikiwiki.
+       if ((grep { $_ eq $libdir } @INC) &&
+            (! exists $ENV{PERL5LIB} || ! length $ENV{PERL5LIB} ||
+            $ENV{PERL5LIB} ne $libdir)) {
                $_="";
        }
        else {