dumping ground for random patches and texts
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: spew@80x24.org
Subject: [PATCH 1/4] ci/profiles: strip everything after the `-' in utsname.release
Date: Sun, 10 Sep 2023 02:05:50 +0000	[thread overview]
Message-ID: <20230910020554.17872-1-e@80x24.org> (raw)

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 <<EOM if $vstr lt $min_ver;
-ID=$ID release=$release ($version) too old to support
+ID=$ID VERSION_ID=$VERSION_ID release=$release ($version) too old to support
 EOM
 }
 my $PKG_FMT = do {

             reply	other threads:[~2023-09-10  2:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-10  2:05 Eric Wong [this message]
2023-09-10  2:05 ` [PATCH 2/4] treewide: favor Xapian (SWIG binding) over Search::Xapian Eric Wong
2023-09-10  2:05 ` [PATCH 3/4] ds: use constants for @UNBLOCKABLE list Eric Wong
2023-09-10  2:05 ` [PATCH 4/4] spawn: do not block ABRT/BUS/ILL/SEGV signals Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230910020554.17872-1-e@80x24.org \
    --to=e@80x24.org \
    --cc=spew@80x24.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).