* [PATCH] ci/profiles: strip everything after the `-' in utsname.release
@ 2023-09-10 2:05 7% Eric Wong
0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2023-09-10 2:05 UTC (permalink / raw)
To: meta
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 {
^ permalink raw reply related [relevance 7%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2023-09-10 2:05 7% [PATCH] ci/profiles: strip everything after the `-' in utsname.release Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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).