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,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE 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 D0E241F452 for ; Sat, 16 Dec 2023 11:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1702725196; bh=Z/FDrLr6Mc7E5ibCW4/47hsYXLzqJleDH1YS6uRJwWc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ue2sgfU6bclnV3iN6VXtb+CdvPAYJnKcq1TknAnqfpa0O+W8Uc6Yk/0XOesgNOTAp iqtAIOsz/CZy4kkcFwt6J+64O0E706XRcXFg86uNmBcpHPclowiQ0fGRfjMAsRDMDf wcEBMbfLQtnFreiaqd2aeOJl1PfHYkgPrDyEruIo= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/2] lei index: support +L: labels Date: Sat, 16 Dec 2023 11:13:15 +0000 Message-ID: <20231216111316.397070-2-e@80x24.org> In-Reply-To: <20231216111316.397070-1-e@80x24.org> References: <20231216111316.397070-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: `lei index' should be capable of indexing the the same way `lei import' does, but without the indexing. I only noticed this omission while developing a new feature. --- lib/PublicInbox/LEI.pm | 2 +- t/lei-index.t | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index a89bdc51..17431518 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -259,7 +259,7 @@ tag => [ 'KEYWORDS... LOCATION...|--stdin', 'reindex' => [ '', 'reindex all locally-indexed messages', @c_opt ], -'index' => [ 'LOCATION...', 'one-time index from URL or filesystem', +'index' => [ 'LOCATION... [LABELS...]', 'one-time index from URL or filesystem', qw(in-format|F=s kw! offset=i recursive|r exclude=s include|I=s verbose|v+ incremental!), @net_opt, # mainly for --proxy= @c_opt ], diff --git a/t/lei-index.t b/t/lei-index.t index c31b1c3c..2b28f1be 100644 --- a/t/lei-index.t +++ b/t/lei-index.t @@ -48,9 +48,10 @@ symlink(File::Spec->rel2abs('t/mda-mime.eml'), "$tmpdir/md1/cur/x:2,S") or test_lei({ tmpdir => $tmpdir }, sub { my $store_path = "$ENV{HOME}/.local/share/lei/store/"; - lei_ok('index', "$tmpdir/md"); + lei_ok qw(index +L:md), "$tmpdir/md"; lei_ok(qw(q mid:qp@example.com)); my $res_a = json_utf8->decode($lei_out); + is_deeply $res_a->[0]->{L}, [ 'md' ], 'label set on index'; my $blob = $res_a->[0]->{'blob'}; like($blob, qr/\A[0-9a-f]{40,}\z/, 'got blob from qp@example'); lei_ok(qw(-C / blob), $blob);