X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FAdminEdit.pm;h=c8c3d3e8aeb44aae4c1202c273465fe9100d3267;hb=23af251dd607c4e75ab1e68063f2c885c48cc035;hp=2e2a8629da2806f09df171422afc7c012fad4246;hpb=c477bdd8a80eecc319b680764edfb24bd12cb7b2;p=public-inbox.git
diff --git a/lib/PublicInbox/AdminEdit.pm b/lib/PublicInbox/AdminEdit.pm
index 2e2a8629..c8c3d3e8 100644
--- a/lib/PublicInbox/AdminEdit.pm
+++ b/lib/PublicInbox/AdminEdit.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2019 all contributors
+# Copyright (C) 2019-2021 all contributors
# License: AGPL-3.0+
# common stuff between -edit, -purge (and maybe -learn in the future)
@@ -6,7 +6,7 @@ package PublicInbox::AdminEdit;
use strict;
use warnings;
use PublicInbox::Admin;
-our @OPT = qw(all force|f verbose|v!);
+our @OPT = qw(all force|f verbose|v! help|h);
sub check_editable ($) {
my ($ibxs) = @_;
@@ -25,10 +25,11 @@ sub check_editable ($) {
# it's possible for a Xapian directory to exist,
# but Search::Xapian to go missing/broken.
# Make sure it's purged in that case:
- $ibx->over or die "no over.sqlite3 in $ibx->{mainrepo}\n";
+ $ibx->over or die "no over.sqlite3 in $ibx->{inboxdir}\n";
+
+ require PublicInbox::Search;
+ my $xdir_ro = PublicInbox::Search->new($ibx)->xdir(1);
- # $ibx->{search} is populated by $ibx->over call
- my $xdir_ro = $ibx->{search}->xdir(1);
my $nshard = 0;
foreach my $shard (<$xdir_ro/*>) {
if (-d $shard && $shard =~ m!/[0-9]+\z!) {
@@ -51,7 +52,7 @@ sub check_editable ($) {
# $rewrites = [ array commits keyed by epoch ]
sub show_rewrites ($$$) {
my ($fh, $ibx, $rewrites) = @_;
- print $fh "$ibx->{mainrepo}:";
+ print $fh "$ibx->{inboxdir}:";
if (scalar @$rewrites) {
my $epoch = -1;
my @out = map {;