Subject: Re: detecting -current versions
To: None <current-users@NetBSD.ORG>
From: Simon J. Gerraty <sjg@frodo.dn.itg.telecom.com.au>
List: current-users
Date: 09/01/1995 16:30:40
> > Hmmm... I think the need for this is just a reflection of the need
> > for a new release.  You could just read ident strings, if it can't
> > wait...

Its also something that would always be useful.

As an example, the following patch to /sys/conf/newvers.sh
will append the content of /usr/src/sup.date to osrelease[] if it is a
-current version.

I seem to recall that someone modified sup to store dates in ascii?
If so you could make src/sup.date -> somewhere/when.allsrc or
something like that.  

I simply just echo YYMMDD > /usr/src/sup.date as part of my import
script. 

So the vers.c created looks like:

# cat vers.c
char ostype[] = "NetBSD";
char osrelease[] = "1.0A-950818";
char sccs[4] = { '@', '(', '#', ')' };
char version[] =     "NetBSD 1.0A-950818 (tmp) #0: Fri Sep  1 17:16:15 EST 1995\n    root@hobbit:/tmp\n";

Thus uname -r should print 1.0A-950818

Feel free to fiddle the format, but I think the basic idea is useful.

Index: newvers.sh
===================================================================
RCS file: usr.src/sys/conf/newvers.sh,v
retrieving revision 1.1.1.1
diff -c -b -r1.1.1.1 newvers.sh
*** /tmp/T0a18734	Fri Sep  1 16:25:20 1995
--- newvers.sh	Fri Sep  1 16:23:20 1995
***************
*** 47,52 ****
--- 47,60 ----
  ost="NetBSD"
  osr="1.0A"
  
+ case "$osr" in
+ *A)
+         # a -current snapshot, what date?
+         SUP_DATE=${SUP_DATE-/usr/src/sup.date}
+         test -s $SUP_DATE && osr="${osr}-`cat $SUP_DATE`"
+         ;;
+ esac
+ 
  echo "char ostype[] = \"${ost}\";" > vers.c
  echo "char osrelease[] = \"${osr}\";" >> vers.c
  echo "char sccs[4] = { '@', '(', '#', ')' };" >> vers.c