]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - pm_filter
web commit by JoshTriplett: Differentiate the postformtext of plugins/contrib from...
[git.ikiwiki.info.git] / pm_filter
index 89449bd914122b88f85145a7fd7223ac5635f021..a80ce04f0e7b015540df972a9356805a13b8323d 100755 (executable)
--- a/pm_filter
+++ b/pm_filter
@@ -3,6 +3,7 @@
 BEGIN {
        $prefix=shift;
        $ver=shift;
+       $libdir=shift;
 }
 
 if (/INSTALLDIR_AUTOREPLACE/) {
@@ -12,5 +13,13 @@ elsif (/VERSION_AUTOREPLACE/) {
        $_=qq{our \$version="$ver";};
 }
 elsif (/^use lib/) {
-       $_="";
+       if (grep { $_ eq $libdir } @INC) {
+               $_="";
+       }
+       else {
+               $_="use lib '$libdir';\n";
+       }
+}
+elsif ($. == 1 && $ENV{NOTAINT} && m{^(#!/usr/bin/perl) -T$}) {
+       $_=qq{$1\n};
 }