Subject: osrelease.sh and param.h
To: None <tech-kern@netbsd.org>
From: Simon Burge <simonb@netbsd.org>
List: tech-kern
Date: 05/06/1999 10:10:59
How does the following look to reduce to one file the place where we
update the kernel version?  I've tested this with a kernel compile and
building distrib notes and all seems fine.

I originally tinkered with parsing the value of __NetBSD_Version__, but
this value doesn't take into account things like _ALPHA and _BETA which
seem to have no representation at the moment.

Index: conf/osrelease.sh
===================================================================
RCS file: /cvsroot/src/sys/conf/osrelease.sh,v
retrieving revision 1.17
diff -p -u -r1.17 osrelease.sh
--- osrelease.sh	1999/05/05 20:04:23	1.17
+++ osrelease.sh	1999/05/06 00:03:57
@@ -37,9 +37,12 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-# Release number to use
-release=1.4B
+# DO NOT UPDATE THIS FILE WITH THE KERNEL VERSION.
+# UPDATE sys/sys/param.h
 
+# Get the release number to use
+paramh=`dirname $0`/../sys/param.h
+release=`awk '/^#define[ \t]*__NetBSD_Version__/ { print $6 }' $paramh`
 
 case $1 in
 -s)
Index: sys/param.h
===================================================================
RCS file: /cvsroot/src/sys/sys/param.h,v
retrieving revision 1.60
diff -p -u -r1.60 param.h
--- param.h	1999/05/05 20:03:59	1.60
+++ param.h	1999/05/06 00:03:57
@@ -63,6 +63,9 @@
  *	And:
  *	     NetBSD-1.2.1 = 102000100
  *
+ * NOTE: sys/conf/osrelease uses the 6th field of the line - it
+ *       _must_ correspond to __NetBSD_Version__.
+ *
  */
 
 #define __NetBSD_Version__  104020000	/* NetBSD 1.4B */

Simon.