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 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 112BB1F4CC for ; Wed, 1 Jan 2025 22:37:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1735771020; bh=AU32M3j6Ik5ZZyOc/U3rZ5EZypkZAvpne3ikO6u9DOc=; h=From:To:Subject:Date:From; b=o4nZq5OZGXRDuU8AwUl00I2swZG/oJdm9yVamWXl6qrJwyEnTXhnEiFbXnmMSxHxo D8BrvsGo3TBZF4FnQVvm0ZNS2AhLQx3ssAtq0MqXIZj8zqyjvUaypvlBK5RPawFTkA pmyt5D9Ilc1KlA1JeMxbqadyPEJ98RvQqZSGeN4E= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] test_common: support `require_mods "v2"' for v2 inboxes Date: Wed, 1 Jan 2025 22:36:59 +0000 Message-ID: <20250101223659.2477114-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: For our purposes, `v2' should be interpreted as a public-inbox format and not as a Perl version (e.g. `use v5.12'). This ensures v2index-late-dupe.t correctly depends on DBD::SQLite and git v2.6+ via `require_mods "v2"' instead of requiring Perl v2.x. On a side note, it's unlikely public-inbox-v3 format will ever be necessary as the v2 format appears scalable enough; thus we won't hit v5 and risk conflicting with in-use Perl versions. However, I'm not ruling out a v2.112 format for (nearly) transparent v1->v2 migrations. --- lib/PublicInbox/TestCommon.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index 0f5b107d..a887fef8 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -209,6 +209,13 @@ sub require_mods (@) { push @mods, qw(DBD::SQLite Xapian +SCM_RIGHTS); $mod = 'json'; # fall-through } + if ($mod eq 'v2') { + require_git v2.6, $maybe ? $maybe : 0; + push @mods, 'DBD::SQLite'; + next; + } elsif ($mod =~ /\Av/) { # don't confuse with Perl versions + Carp::croak "BUG: require_mods `$mod' ambiguous"; + } if ($mod eq 'json') { $mod = 'Cpanel::JSON::XS||JSON::MaybeXS||JSON||JSON::PP' } elsif ($mod eq '-httpd') {