We'll just warn them about our non-existent prune support, for now, and implement --prune in the next commit. --- lib/PublicInbox/CodeSearchIdx.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/lib/PublicInbox/CodeSearchIdx.pm b/lib/PublicInbox/CodeSearchIdx.pm index 4f91e0b6..e875b93e 100644 --- a/lib/PublicInbox/CodeSearchIdx.pm +++ b/lib/PublicInbox/CodeSearchIdx.pm @@ -547,7 +547,19 @@ sub load_existing ($) { # for -u/--update local $self->{xdb}; $self->xdb or die "E: $self->{cidx_dir} non-existent for --update\n"; - my @cur = $self->all_terms('P'); + my @missing; + my @cur = grep { + if (-e $_) { + 1; + } else { + push @missing, $_; + undef; + } + } $self->all_terms('P'); + @missing and warn "W: the following repos no longer exist:\n", + (map { "W:\t$_\n" } @missing), + "W: use --prune to remove them from ", + $self->{cidx_dir}, "\n"; push @$dirs, @cur; } my %uniq; # List::Util::uniq requires Perl 5.26+