diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-09-18 20:53:17 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-09-18 20:53:17 +0000 |
commit | 62e1a2ceed6d99e3606d81effaa71e009dbeb121 (patch) | |
tree | d14ed53461e14be94a94e9752ba7e22b199ae62e /IkiWiki/Plugin | |
parent | f276e42430006baf6a97889b899d4de399ae5310 (diff) | |
download | ikiwiki-62e1a2ceed6d99e3606d81effaa71e009dbeb121.tar ikiwiki-62e1a2ceed6d99e3606d81effaa71e009dbeb121.tar.gz |
estseek patch (slightly altered) and other replies
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/search.pm | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index 2d8c3d4e1..5a4dfd491 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -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 ($;@) { #{{{ |