From b300bc9650a40885cd8c6e0a646436539aed95c1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 26 Jul 2010 16:23:10 -0400 Subject: [PATCH] use new disable hook clean up xapian db when plugin is disabled --- IkiWiki/Plugin/search.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index ff5d0ccbe..1cf762fce 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -13,6 +13,7 @@ sub import { hook(type => "indexhtml", id => "search", call => \&indexhtml); hook(type => "delete", id => "search", call => \&delete); hook(type => "cgi", id => "search", call => \&cgi); + hook(type => "disable", id => "search", call => \&disable); } sub getsetup () { @@ -245,4 +246,10 @@ sub setupfiles () { } } +sub disable () { + if (-d $config{wikistatedir}."/xapian") { + system("rm", "-rf", $config{wikistatedir}."/xapian"); + } +} + 1 -- 2.39.5