From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 24B0D1F66E for ; Tue, 1 Sep 2020 16:54:32 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] index: check for xapian-compact when using --compact Date: Tue, 1 Sep 2020 16:54:31 +0000 Message-Id: <20200901165431.29246-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Otherwise, users may be frustrated to discover it missing a long indexing run. --- script/public-inbox-index | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/public-inbox-index b/script/public-inbox-index index 89c6b782..5dad6ecb 100755 --- a/script/public-inbox-index +++ b/script/public-inbox-index @@ -64,10 +64,14 @@ foreach my $ibx (@ibxs) { PublicInbox::Admin::scan_ibx_modules($mods, $ibx); } +# "Search::Xapian" includes SWIG "Xapian", too: +$opt->{compact} = 0 if !$mods->{'Search::Xapian'}; + PublicInbox::Admin::require_or_die(keys %$mods); my $env = PublicInbox::Admin::index_prepare($opt, $cfg); local %ENV = (%ENV, %$env) if $env; require PublicInbox::InboxWritable; +PublicInbox::Xapcmd::check_compact() if $opt->{compact}; PublicInbox::Admin::progress_prepare($opt); for my $ibx (@ibxs) { $ibx = PublicInbox::InboxWritable->new($ibx);