about summary refs log tree commit homepage
path: root/script/public-inbox-index
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-05-29 20:56:32 +0000
committerEric Wong <e@80x24.org>2019-05-29 20:56:59 +0000
commit3c9ab47c7d0e26fd22e1f42a198696b093629802 (patch)
treeaa6df6d879d82ced06add1d4869c81336d2664e5 /script/public-inbox-index
parent4f814ff418e334a9b7b9bd96cd5450c2823de2f6 (diff)
downloadpublic-inbox-3c9ab47c7d0e26fd22e1f42a198696b093629802.tar.gz
And use it from Admin.

It's easy to tell what indexlevel=basic is from unconfigured
inboxes, but distinguishing between 'medium' and 'full' would
require stat()-ing position.* files which is fragile and
Xapian-implementation-dependent.

So use the metadata facility of Xapian and store it in the main
partition so Admin tools can deal better with unconfigured
inboxes copied using generic tools like cp(1) or rsync(1).
Diffstat (limited to 'script/public-inbox-index')
-rwxr-xr-xscript/public-inbox-index7
1 files changed, 3 insertions, 4 deletions
diff --git a/script/public-inbox-index b/script/public-inbox-index
index e4a7be19..439da157 100755
--- a/script/public-inbox-index
+++ b/script/public-inbox-index
@@ -25,10 +25,9 @@ PublicInbox::Admin::require_or_die('-index');
 usage() unless @ibxs;
 my $mods = {};
 foreach my $ibx (@ibxs) {
-        if (defined $opt->{indexlevel} && !defined($ibx->{indexlevel})) {
-                # XXX: users can shoot themselves in the foot, with this...
-                $ibx->{indexlevel} = $opt->{indexlevel};
-        }
+        # XXX: users can shoot themselves in the foot, with opt->{indexlevel}
+        $ibx->{indexlevel} //= $opt->{indexlevel} //
+                        PublicInbox::Admin::detect_indexlevel($ibx);
         PublicInbox::Admin::scan_ibx_modules($mods, $ibx);
 }