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 17C421F53E for ; Tue, 21 Mar 2023 23:07:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1679440069; bh=7ODooB5D158/5KIANgyOTr0gXfhom+Uwwsk4iMzqaYQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PlWfW63q2n+2zbq0zyQeaNM8t015JI5caYgjEz0wgdC9UqPaTgfwA2k7m72+Q23bL Z99ItceLGodvUBFKoZBMvwkDUu63jS+Yw0eofgAxSProv874xO5wqp0sGx+HWXmjZB HzhSDt6y5KBLwpDdGVPfM3Tl86tEmMnCqKFY13sc= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 26/28] cindex: squelch incompatible options Date: Tue, 21 Mar 2023 23:07:41 +0000 Message-Id: <20230321230743.3020032-26-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: Some options don't make sense when used together. --- lib/PublicInbox/CodeSearchIdx.pm | 2 +- script/public-inbox-cindex | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/CodeSearchIdx.pm b/lib/PublicInbox/CodeSearchIdx.pm index 5e6c0d22..21c43973 100644 --- a/lib/PublicInbox/CodeSearchIdx.pm +++ b/lib/PublicInbox/CodeSearchIdx.pm @@ -734,7 +734,7 @@ sub cidx_run { # main entry point $m =~ s/\A(#?\s*)/$1$self->{current_info}: /; $cb->($m, @_); }; - load_existing($self); + load_existing($self) unless $self->{-internal}; local $REINDEX; if ($self->{-opt}->{reindex}) { require PublicInbox::SharedKV; diff --git a/script/public-inbox-cindex b/script/public-inbox-cindex index e2500b93..f8a3ebbb 100755 --- a/script/public-inbox-cindex +++ b/script/public-inbox-cindex @@ -52,6 +52,11 @@ my @git_dirs; if (defined(my $pl = $opt->{'project-list'})) { my $pfx = shift @ARGV // die <); @@ -67,6 +72,9 @@ if (defined $cidx_dir) { # external index } elsif (!@git_dirs) { die $help } else { + die <{update}; +--update requires `-d EXTDIR' +EOM for my $gd (@git_dirs) { my $cd = "$gd/public-inbox-cindex"; my $cidx = PublicInbox::CodeSearchIdx->new($cd, { %$opt });