diff --git a/sys/conf/osrelease.sh b/sys/conf/osrelease.sh index 88687ab76480..ef8d7768d0b0 100644 --- a/sys/conf/osrelease.sh +++ b/sys/conf/osrelease.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: osrelease.sh,v 1.110 2005/12/11 12:20:30 christos Exp $ +# $NetBSD: osrelease.sh,v 1.111 2006/08/08 07:05:40 riz Exp $ # # Copyright (c) 1997 The NetBSD Foundation, Inc. # All rights reserved. @@ -38,10 +38,17 @@ # # We use the number specified in -${AWK:-awk} -v FLAG="$1" ' -/^#define[ ]*__NetBSD_Version__/ { - major = ($3 / 100000000); - minor = ($3 / 1000000) % 100; - patch = ($3 / 100) % 100; - printf((FLAG == "-s") ? "%d%d%d\n" : "%d.%d.%d\n", major, minor, patch); -}' "$(dirname $0)"/../sys/param.h + +AWK=${AWK:-awk} +GREP=${GREP:-grep} +PARAMH="`dirname $0`"/../sys/param.h +release=`$AWK '/^#define[ ]*__NetBSD_Version__/ { print $6 }' $PARAMH` + +case $1 in +-s) + echo $release | sed -e 's,\.,,g' + ;; +*) + echo $release + ;; +esac