X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FAdmin.pm;h=11ea8f8307c2082ec974d51763df3f5f2983fa8c;hb=HEAD;hp=2534958b121e691ecee1e963fde736d03383c30f;hpb=dd80dcaa1e46543893de533938a1651639f91f10;p=public-inbox.git diff --git a/lib/PublicInbox/Admin.pm b/lib/PublicInbox/Admin.pm index 2534958b..11ea8f83 100644 --- a/lib/PublicInbox/Admin.pm +++ b/lib/PublicInbox/Admin.pm @@ -198,8 +198,7 @@ sub resolve_inboxes ($;$$) { $opt->{-eidx_ok} ? (\@ibxs, \@eidx) : @ibxs; } -# TODO: make Devel::Peek optional, only used for daemon -my @base_mod = qw(Devel::Peek); +my @base_mod = (); my @over_mod = qw(DBD::SQLite DBI); my %mod_groups = ( -index => [ @base_mod, @over_mod ], @@ -274,7 +273,7 @@ sub index_inbox { if (my $pr = $opt->{-progress}) { $pr->("indexing $ibx->{inboxdir} ...\n"); } - local %SIG = %SIG; + local @SIG{keys %SIG} = values %SIG; setup_signals(\&index_terminate, $ibx); my $idx = { current_info => $ibx->{inboxdir} }; local $SIG{__WARN__} = sub { @@ -321,7 +320,7 @@ sub progress_prepare ($;$) { } else { $opt->{verbose} ||= 1; $dst //= *STDERR{GLOB}; - $opt->{-progress} = sub { print $dst @_ }; + $opt->{-progress} = sub { print $dst '# ', @_ }; } } @@ -369,7 +368,19 @@ sub index_prepare ($$) { or die "`$git_key=$s' not boolean\n"; $opt->{$k} = $v; } + for my $k (qw(since until)) { + my $v = $opt->{$k} // next; + $opt->{reindex} or die "--$k=$v requires --reindex\n"; + } $env; } +sub do_chdir ($) { + my $chdir = $_[0] // return; + for my $d (@$chdir) { + next if $d eq ''; # same as git(1) + chdir $d or die "cd $d: $!"; + } +} + 1;