web commit by RecaiOktas: Using FindBin in ikiwiki.pl.
[ikiwiki.git] / doc / bugs / svn_post-commit_wrapper_can__39__t_find_IkiWiki.pm_if_not_installed.mdwn
1 If you're using ikiwiki without installing it, the svn post-commit wrapper will die (in a difficult-to-debug way) when it tries to execute ikiwiki.pl because it can't find IkiWiki.pm.
2
3 I'm not sure how to fix this in a secure way. For now I'm just changing use lib '.' in ikiwiki.pl to point to the hard-coded directory where ikiwiki was unpacked.
4
5 > This workaround doesn't work here.  "`./ikiwiki.pl --setup ikiwiki.setup`" is ok, but the
6 > wrappers fail in action.  The below patch seems fine (only the relevant part). --[[Roktas]]
7
8     -use lib '.'; # For use without installation, removed by Makefile.
9     +use FindBin qw($Bin); # WILL_BE_REMOVED by Makefile.
10     +use lib ($Bin=~/(.+)/ ? "$1" : '.'); # For use without installation, WILL_BE_REMOVED by Makefile.