+for my $ibx (@ibxs) {
+ $ibx = PublicInbox::InboxWritable->new($ibx);
+ if ($opt->{compact} >= 2) {
+ PublicInbox::Xapcmd::run($ibx, 'compact', $opt->{compact_opt});
+ }
+ $ibx->{-no_fsync} = 1 if !$opt->{fsync};
+ $ibx->{-skip_docdata} //= $opt->{'skip-docdata'};
+
+ my $ibx_opt = $opt;
+ if (defined(my $s = $ibx->{lc('indexSequentialShard')})) {
+ defined(my $v = $cfg->git_bool($s)) or die <<EOL;
+publicInbox.$ibx->{name}.indexSequentialShard not boolean
+EOL
+ $ibx_opt = { %$opt, 'sequential-shard' => $v };
+ }
+ my $nidx = PublicInbox::Admin::index_inbox($ibx, undef, $ibx_opt);
+ last if $ibx_opt->{quit};
+ if (my $copt = $opt->{compact_opt}) {
+ local $copt->{jobs} = 0 if $ibx_opt->{'sequential-shard'};
+ PublicInbox::Xapcmd::run($ibx, 'compact', $copt);
+ }
+ last if $ibx_opt->{quit};
+ next if $ibx->{-unconfigured} || !$nidx;
+ for my $eidx (@eidx) {
+ $eidx->attach_inbox($ibx);
+ }
+}
+my $pr = $opt->{-progress};
+for my $eidx (@eidx) {
+ $pr->("indexing $eidx->{topdir} ...\n") if $pr;
+ $eidx->eidx_sync($opt);
+ last if $opt->{quit};
+}