You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pm_filter 747B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/perl -i -p
  2. BEGIN {
  3. $prefix=shift;
  4. $ver=shift;
  5. $libdir=shift;
  6. }
  7. if (/INSTALLDIR_AUTOREPLACE/) {
  8. $_=qq{our \$installdir="$prefix";};
  9. }
  10. elsif (/VERSION_AUTOREPLACE/) {
  11. $_=qq{our \$version="$ver";};
  12. }
  13. elsif (/^use lib/) {
  14. # The idea here is to figure out if the libdir the Makefile.PL
  15. # was configured to use is in perl's normal search path.
  16. # If not, hard code it into ikiwiki.
  17. if ((grep { $_ eq $libdir } @INC) &&
  18. (! exists $ENV{PERL5LIB} || ! length $ENV{PERL5LIB} ||
  19. $ENV{PERL5LIB} ne $libdir)) {
  20. $_="";
  21. }
  22. else {
  23. $_="use lib '$libdir';\n";
  24. }
  25. }
  26. elsif ($. == 1 && ($ENV{NOTAINT}=0) && m{^(#!.*perl.*?)$}) {
  27. $_=qq{$1 -T\n};
  28. }
  29. elsif (/^\$ENV{PATH}="(.*)";/) {
  30. $_="\$ENV{PATH}=\"$1:$prefix/bin\";\n";
  31. }