From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 4FEAF1F428 for ; Tue, 21 Mar 2023 23:07:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1679440068; bh=J1JBt1VjLNAEtg9luO8eFe05QZXFl6E09s7SOsM+rjg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BJBbGUD80OjofceL1iNDroUHt8o9bC11J5YKkMpP76sfChbfoEG/U+znQLa8hAtNt Agjz4aNW7h/qVSga589gkVUfjpeyVt5sFVK3RYwzNSwsghFIgVyvM5nLrMVAH8FrM+ jIwHPHR+UegCJFGvVAhu84HxDrS0KSmR1UokEkXU= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 23/28] cindex: filter out non-existent git directories Date: Tue, 21 Mar 2023 23:07:38 +0000 Message-Id: <20230321230743.3020032-23-e@80x24.org> In-Reply-To: <20230321230743.3020032-1-e@80x24.org> References: <20230321230701.3019936-1-e@80x24.org> <20230321230743.3020032-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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+