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 CD80D1F55F for ; Sun, 10 Sep 2023 02:05:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1694311533; bh=2Ay0+OV0qt06/V8SDrdBoPTz/SB7RFfgv31WcC0UQiM=; h=From:To:Subject:Date:From; b=1cm4Q9xemGB3ZuAkyY0VGG5cJY8LrVeH9BoaB09n/OIy8NO1+Zn5Kvu96VEhxa1tl RgMrg1aiHKR6nJOsx8bEjg95PSs+yZQldODWeeVM2yP8ztkxNcVWYfMpbw3THZr11w +BUooHxpGcp84ZFgk8y/oVxpXf3/OYpbBwlYQF+A= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] ci/profiles: strip everything after the `-' in utsname.release Date: Sun, 10 Sep 2023 02:05:32 +0000 Message-ID: <20230910020532.17859-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This fixes the script under FreeBSD (tested 13.2) FreeBSD 13.2 has `13.2-RELEASE-p3' in its uname(2) utsname.release. While the `.2' component is a welcome addition over the old script, Perl parses the `-' as a subtraction operation, which isn't what we want. --- ci/profiles.perl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ci/profiles.perl b/ci/profiles.perl index 5b441790..720cd24e 100755 --- a/ci/profiles.perl +++ b/ci/profiles.perl @@ -49,9 +49,12 @@ $VERSION_ID //= 0; # numeric? could be 'sid', actually... my %MIN_VER = (freebsd => v11, openbsd => v7.3, netbsd => v9.3); if (defined(my $min_ver = $MIN_VER{$^O})) { - my $vstr = eval "v$VERSION_ID"; + my $vid = $VERSION_ID; + $vid =~ s/-.*\z//s; # no dashes in v-strings + my $vstr = eval "v$vid"; + die "can't convert VERSION_ID=$VERSION_ID to v-string" if $@; die <