Subject: kern/1432: identifying -current versions
To: None <>
From: Simon J. Gerraty <>
List: netbsd-bugs
Date: 09/03/1995 21:40:09
>Number:         1432
>Category:       kern
>Synopsis:       Adds SUP date to uname -r output
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Sep  4 18:05:04 1995
>Originator:     Simon J. Gerraty
Zen Programming...
>Release:        950818
System: NetBSD 1.0A.95.08.18 NetBSD 1.0A (ZEN) #0: Fri Aug 18 18:59:14 EST 1995 i386

1.0A is not really enough to identify a -current version.

Since most folk refer to the SUP date as the version they are running,
it makes sense to include this information in the output of uname -r.

The following patch to sys/conf/ relies on a file (eg
/usr/src/ containing the date the sources were SUPed.
The content are appended to $osr, so that if contains any of

then uname -r would print 1.0A.YY.MM.DD

The patch has no effect unless $osr ends in A as is the case for
-current versions.

RCS file: /local/src/master/usr.src/sys/conf/,v
retrieving revision
diff -c -b -r1.1.1.1
***  1995/04/11 08:47:05
---  1995/09/03 03:56:58
*** 47,52 ****
--- 47,62 ----
+ case "$osr" in
+ *A)
+         # a -current snapshot, what date?
+         SUP_DATE=${SUP_DATE-/usr/src/}
+         # the sed command will turn all of YYMMDD, YY.MM.DD etc
+         # into .YY.MM.DD
+         test -s $SUP_DATE && osr="${osr}`sed 's,[^0-9]*\([0-9][0-9]\),.\1,g' $SUP_DATE`"
+         ;;
+ esac
  echo "char ostype[] = \"${ost}\";" > vers.c
  echo "char osrelease[] = \"${osr}\";" >> vers.c
  echo "char sccs[4] = { '@', '(', '#', ')' };" >> vers.c