NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/60810: /usr/src/sys/conf/osrelease.h -s behavior does not match description
The following reply was made to PR kern/60810; it has been noted by GNATS.
From: Rob Whitlock <rwhitlock22%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: kern/60810: /usr/src/sys/conf/osrelease.h -s behavior does not
match description
Date: Sun, 27 Sep 2026 14:42:54 -0400
Here's a patch to correct the problem. osrelease.sh and sys/param.h were =
not explicit about the possible formats for the free-form text parameter =
rel_text, so I'm not sure that this patch covers the intended use cases. =
I tested it with the lines
#define __NetBSD_Version__ 1199000800 /* NetBSD 11.99.8 */
and
#define __NetBSD_Version__ 1002000000 /* NetBSD 10.2_STABLE */
If there are other formats that this patch should cover that it doesn't =
already, please let me know.
--- osrelease.sh.orig 2026-09-27 11:49:28.581326300 -0400
+++ osrelease.sh 2026-09-27 12:48:51.397562919 -0400
@@ -71,13 +71,15 @@
beta=3D${3#[0-9]}
beta=3D${beta#[0-9]}
shift 3
+patch=3D$1
+[ -n "$patch" ] && shift
IFS=3D' '
-set -- $rel_MM ${rel_mm#0}$beta $*
=20
case "$option" in
-k)
if [ ${rel_mm#0} =3D 99 ]
then
+ set -- $rel_MM ${rel_mm#0}$beta $patch $*
IFS=3D.
echo "$*"
else
@@ -92,10 +94,16 @@
echo "${rel_MM}.${rel_mm#0}"
;;
-s)
+ if [ -z "$patch" ]; then
+ set -- $rel_MM ${rel_mm#0}$beta $*
+ else
+ set -- $rel_MM ${rel_mm#0}$beta `printf '%02d' $patch` =
$*
+ fi
IFS=3D
echo "$*"
;;
*)
+ set -- $rel_MM ${rel_mm#0}$beta $patch $*
IFS=3D.
echo "$*"
;;=
Home |
Main Index |
Thread Index |
Old Index