]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/search.pm
estseek patch (slightly altered) and other replies
[git.ikiwiki.info.git] / IkiWiki / Plugin / search.pm
index 2d8c3d4e16305cf07700ec09553535d08a9aeb57..5a4dfd491a896047e354b46af7f389ff3b994db5 100644 (file)
@@ -7,6 +7,8 @@ use strict;
 use IkiWiki;
 
 sub import { #{{{
+       hook(type => "getopt", id => "hyperestraier",
+               call => \&getopt);
        hook(type => "checkconfig", id => "hyperestraier",
                call => \&checkconfig);
        hook(type => "pagetemplate", id => "hyperestraier",
@@ -19,6 +21,12 @@ sub import { #{{{
                call => \&cgi);
 } # }}}
 
+sub getopt () { #{{{
+        eval q{use Getopt::Long};
+        Getopt::Long::Configure('pass_through');
+        GetOptions("estseek=s" => \$config{estseek});
+} #}}}
+
 sub checkconfig () { #{{{
        foreach my $required (qw(url cgiurl)) {
                if (! length $config{$required}) {
@@ -99,8 +107,9 @@ sub estcfg () { #{{{
        close TEMPLATE;
        $cgi="$estdir/".IkiWiki::basename($config{cgiurl});
        unlink($cgi);
-       symlink("/usr/lib/estraier/estseek.cgi", $cgi) ||
-               error("symlink $cgi: $!");
+       my $estseek = defined $config{estseek} ? $config{estseek} : '/usr/lib/estraier/estseek.cgi';
+       symlink($estseek, $cgi) ||
+               error("symlink $estseek $cgi: $!");
 } # }}}
 
 sub estcmd ($;@) { #{{{