pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk mk: When calculating OPSYS_VERSION, use the userlan...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/aef5bd1575ce
branches:  trunk
changeset: 382186:aef5bd1575ce
user:      nia <nia%pkgsrc.org@localhost>
date:      Fri Jul 22 09:14:43 2022 +0000

description:
mk: When calculating OPSYS_VERSION, use the userland version (/etc/release)
on NetBSD, rather than the kernel version. Should resolve building
packages with workarounds for -9 on a -9 userland and CURRENT kernel.

Thanks to Hauke Fath for the hint.

diffstat:

 mk/bsd.prefs.mk |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r aa7daa057a29 -r aef5bd1575ce mk/bsd.prefs.mk
--- a/mk/bsd.prefs.mk   Fri Jul 22 09:07:21 2022 +0000
+++ b/mk/bsd.prefs.mk   Fri Jul 22 09:14:43 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.422 2022/06/07 10:04:25 jperkin Exp $
+# $NetBSD: bsd.prefs.mk,v 1.423 2022/07/22 09:14:43 nia Exp $
 #
 # This file includes the mk.conf file, which contains the user settings.
 #
@@ -113,8 +113,14 @@
 # it to a custom command in the later OPSYS-specific section.
 #
 .if !defined(OPSYS_VERSION)
+.  if ${OPSYS} == "NetBSD" && exists(/etc/release)
+_OPSYS_VERSION_CMD=    head -1 /etc/release | \
+                       sed -e "s,^NetBSD ,,g" | \
+                       awk -F. '{major=int($$1); minor=int($$2); if (minor>=100) minor=99; patch=int($$3); if (patch>=100) patch=99; printf "%02d%02d%02d", major, minor, patch}'
+.  else
 _OPSYS_VERSION_CMD=    ${UNAME} -r | \
                        awk -F. '{major=int($$1); minor=int($$2); if (minor>=100) minor=99; patch=int($$3); if (patch>=100) patch=99; printf "%02d%02d%02d", major, minor, patch}'
+.  endif
 OPSYS_VERSION=         ${_OPSYS_VERSION_CMD:sh}
 MAKEFLAGS+=            OPSYS_VERSION=${OPSYS_VERSION:Q}
 .endif



Home | Main Index | Thread Index | Old Index