about summary refs log tree commit
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-02-08 18:08:49 +0000
committerEric Wong <e@yhbt.net>2020-02-08 19:55:45 +0000
commitebe41e52d055fd5923497e42bc8cda5a8d5d8bcb (patch)
treed2bf9a61a9ccffa09f0ae537a4b4ee6ae760c349
parent30250c8c20fbdf1fa56775b3ae862f171cc0411d (diff)
downloadpublic-inbox-ebe41e52d055fd5923497e42bc8cda5a8d5d8bcb.tar.gz
We don't want to blow up users storage too badly when converting
v1 to v2 or break because they don't have Xapian bindings installed.
-rwxr-xr-xscript/public-inbox-convert9
1 files changed, 9 insertions, 0 deletions
diff --git a/script/public-inbox-convert b/script/public-inbox-convert
index 906001cb..e13c13f4 100755
--- a/script/public-inbox-convert
+++ b/script/public-inbox-convert
@@ -6,6 +6,7 @@ use warnings;
 use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
 use PublicInbox::InboxWritable;
 use PublicInbox::Config;
+use PublicInbox::Admin;
 use PublicInbox::V2Writable;
 use PublicInbox::Git;
 use PublicInbox::Spawn qw(spawn);
@@ -45,6 +46,14 @@ $old = PublicInbox::InboxWritable->new($old);
 if ($old->version >= 2) {
         die "Only conversion from v1 inboxes is supported\n";
 }
+
+$old->{indexlevel} //= PublicInbox::Admin::detect_indexlevel($old);
+if ($index) {
+        my $mods = {};
+        PublicInbox::Admin::scan_ibx_modules($mods, $old);
+        PublicInbox::Admin::require_or_die(keys %$mods);
+}
+
 my $new = { %$old };
 $new->{inboxdir} = abs_path($new_dir);
 $new->{version} = 2;