]> sipb.mit.edu Git - ikiwiki.git/blob - doc/patchqueue/lib-fixup.mdwn
web commit by http://id.inelegant.org/: Fixed typo.
[ikiwiki.git] / doc / patchqueue / lib-fixup.mdwn
1 I'm using Ikiwiki on a box where I don't have root access, so I install all of my Perl modules in `~/lib`. The `ikiwiki.in` script is ran in Taint mode, which means that it ignores the contents of `$ENV{PERL5LIB}`. The result is that the current versions of the pre-requisite modules I've installed in `~/lib` are ignored by `./make`, which uses the outdated, and therefore incompatible versions, from the system-wide `@INC`... ;-)
2
3 I imagine that there's a clean and elegant solution to this, but the hack I'm currently using is to have `./make` alter `ikiwki.in` before it's run, by inserting `use lib ...` lines for each of the directories in `$ENV{PERL5LIB}`. Again, this is clearly ugly, but it allows me to run `./make`, so I'm submitting it FWIW.
4
5 <pre> 
6 Index: lib-fixup.pl
7 ===================================================================
8 --- lib-fixup.pl        (revision 0)
9 +++ lib-fixup.pl        (revision 0)
10 @@ -0,0 +1,7 @@
11 +#!/usr/bin/perl -i.bak -p
12 +use strict;
13 +use warnings;
14 +my $libs = join('', map { "use lib '$_';\n" } split /:/, $ENV{PERL5LIB});
15 +s/(use IkiWiki;)/$1\n$libs/;
16 +
17 +
18
19 Property changes on: lib-fixup.pl
20 ___________________________________________________________________
21 Name: svn:executable
22    + *
23 Index: Makefile.PL
24 ===================================================================
25 --- Makefile.PL (revision 2628)
26 +++ Makefile.PL (working copy)
27 @@ -24,6 +24,7 @@
28  )
29  
30  extra_build:
31 +       LANG=C ./lib-fixup.pl ikiwiki.in
32         LANG=C ./ikiwiki.in doc html --templatedir=templates \
33                 --underlaydir=basewiki \
34                 --wikiname="ikiwiki" --verbose --no-rcs \
35
36 </pre>