search: generate configuration files once only when rebuilding

master
Gabriel McManus 2008-07-07 02:06:10 +10:00 committed by Joey Hess
parent 2aac9cdb30
commit 7b8f4d2d06
1 changed files with 3 additions and 1 deletions

View File

@ -194,14 +194,16 @@ sub xapiandb () { #{{{
return $db;
} #}}}
my $setup;
sub setupfiles () { #{{{
if (! -e $config{wikistatedir}."/xapian" || $config{rebuild}) {
if (! defined $setup and ! -e $config{wikistatedir}."/xapian" || $config{rebuild}) {
writefile("omega.conf", $config{wikistatedir}."/xapian",
"database_dir .\n".
"template_dir ./templates\n");
writefile("query", $config{wikistatedir}."/xapian/templates",
IkiWiki::misctemplate(gettext("search"),
readfile(IkiWiki::template_file("searchquery.tmpl"))));
$setup=1;
}
} #}}}