Module Name:    src
Committed By:   riz
Date:           Wed Nov  2 20:23:34 UTC 2011

Modified Files:
        src/distrib/sets [netbsd-5-0]: sets.subr
        src/sys/conf [netbsd-5-0]: osrelease.sh

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1681):
        distrib/sets/sets.subr: revision 1.133
        sys/conf/osrelease.sh: revision 1.116
        sys/conf/osrelease.sh: revision 1.117
try to match sys/kern/kern_module.c module path logic: for release branches,
use X.Y version (instead of eg. X.Y.0_PATCH or X.Y_STABLE) and for -current use
X.Y.Z.
ok zafer@
Add -n option to print major and minor version, e.g. 5.99 on -current.
Describe new -n option in a comment; improve description of -m option.


To generate a diff of this commit:
cvs rdiff -u -r1.71.2.5 -r1.71.2.5.2.1 src/distrib/sets/sets.subr
cvs rdiff -u -r1.115 -r1.115.10.1 src/sys/conf/osrelease.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/sets.subr
diff -u src/distrib/sets/sets.subr:1.71.2.5 src/distrib/sets/sets.subr:1.71.2.5.2.1
--- src/distrib/sets/sets.subr:1.71.2.5	Wed Apr  8 00:09:27 2009
+++ src/distrib/sets/sets.subr	Wed Nov  2 20:23:34 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: sets.subr,v 1.71.2.5 2009/04/08 00:09:27 snj Exp $
+#	$NetBSD: sets.subr,v 1.71.2.5.2.1 2011/11/02 20:23:34 riz Exp $
 #
 
 #
@@ -215,7 +215,11 @@ if [ "${MACHINE_ARCH}" = "m68000" ]; the
 	shlib=no			# Turn off shlibs for some ports.
 fi
 
-OSRELEASE=`${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh`
+OSRELEASE=`${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh -n`
+# for release branches, use X.Y version, for -current use X.Y.Z
+if [ ! "${OSRELEASE%.99}" = "${OSRELEASE}" ]; then
+	OSRELEASE=`${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh`
+fi
 MODULEDIR="stand/${MACHINE}/${OSRELEASE}/modules"
 SUBST="s#@MODULEDIR@#${MODULEDIR}#g"
 SUBST="${SUBST};s#@OSRELEASE@#${OSRELEASE}#g"
@@ -228,7 +232,7 @@ SUBST="${SUBST};s#@MACHINE@#${MACHINE}#g
 # In each file, a record consists of a path and a System Package name,
 # separated by whitespace. E.g.,
 #
-# 	# $NetBSD: sets.subr,v 1.71.2.5 2009/04/08 00:09:27 snj Exp $
+# 	# $NetBSD: sets.subr,v 1.71.2.5.2.1 2011/11/02 20:23:34 riz Exp $
 # 	.			base-sys-root	[keyword[,...]]
 # 	./altroot		base-sys-root
 # 	./bin			base-sys-root

Index: src/sys/conf/osrelease.sh
diff -u src/sys/conf/osrelease.sh:1.115 src/sys/conf/osrelease.sh:1.115.10.1
--- src/sys/conf/osrelease.sh:1.115	Tue Aug  5 08:26:05 2008
+++ src/sys/conf/osrelease.sh	Wed Nov  2 20:23:34 2011
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: osrelease.sh,v 1.115 2008/08/05 08:26:05 apb Exp $
+#	$NetBSD: osrelease.sh,v 1.115.10.1 2011/11/02 20:23:34 riz Exp $
 #
 # Copyright (c) 1997 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -38,13 +38,18 @@ PARAMH="`dirname $0`"/../sys/param.h
 release=`$AWK '/^#define[ 	]*__NetBSD_Version__/ { print $6 }' $PARAMH`
 
 # default: return nn.nn.nn
-# -m: return the major number -- -current is the number of the next release
+# -m: return nn, representing only the major number; however, for -current,
+#     return the next major number (e.g. for 5.99.nn, return 6)
+# -n: return nn.nn
 # -s: return nnnnnn (no dots)
 
 case $1 in
 -m)
 	echo $release | $AWK -F. '{print int($1+$2/100+0.01)}'
 	;;
+-n)
+	echo $release | $AWK -F. '{print $1 "." $2}'
+	;;
 -s)
 	echo $release | $SED -e 's,\.,,g'
 	;;

Reply via email to