From owner-freebsd-current Sat Apr 18 17:30:40 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA08765 for freebsd-current-outgoing; Sat, 18 Apr 1998 17:30:40 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from shrimp.dataplex.net (shrimp.dataplex.net [208.2.87.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA08723 for ; Sun, 19 Apr 1998 00:30:32 GMT (envelope-from rkw@dataplex.net) Received: from [208.2.87.6] (user6.dataplex.net [208.2.87.6]) by shrimp.dataplex.net (8.8.8/8.8.5) with ESMTP id TAA28563; Sat, 18 Apr 1998 19:30:12 -0500 (CDT) X-Sender: rkw@mail.dataplex.net Message-Id: In-Reply-To: <35391FA6.79CA8363@san.rr.com> References: <353802A2.CB67FCE7@tdx.co.uk> <19980418113504.U1090@freebie.lemis.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Sat, 18 Apr 1998 19:30:08 -0500 To: Studded From: Richard Wackerbarth Subject: Re: Quick Question re: Dmesg & Current Version Cc: Greg Lehey , Karl Pielorz , current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG At 4:48 PM -0500 4/18/98, Studded wrote: >Greg Lehey wrote: > >> Somewhere, probably. When I used ctm, I modified /sys/conf/newvers.sh >> to include the ctm update number in the header, but I haven't found >> anything useful in the CVS database. Let me know if you do. > > I have a little script that I run before a make world, one of the >things it does is insert the date in newvers.sh. > ># Add today's date so I know when this was built >sed s/SNAPDATE=\"\"/SNAPDATE=\"`date +%m%d`\"/ >/usr/src/sys/conf/newvers.sh \ > > /usr/src/sys/conf/newvers.sh.sed >cp /usr/src/sys/conf/newvers.sh.sed /usr/src/sys/conf/newvers.sh && > rm /usr/src/sys/conf/newvers.sh.sed > >echo '' >grep 'SNAPDATE=' /usr/src/sys/conf/newvers.sh > > If you'd like to see the rest of the script, >fetch http://home.san.rr.com/freebsd/mwprep > >Hope this is useful, I go a little further. By storing the date in a file at the time that you update (via cvsup), the date reflects when you got the sources rather than when you did the build. The version string (which is IMHO much too verbose) already has the time of the build built into it. Here are my changes. The first change in newvers.sh is the operative one. The rest are because I am happier with the more terse format. If this is incorporated in the main tree, there will need to be a slight "fix" to take care of the real "SNAP" and "RELEASE" versions. The operative part of the output in vers.c is shown below. Note that the date in the osrelease string is earlier than the build date in the version string. For the CTM users, we could get similar info from the .ctm_status file. char ostype[] = "FreeBSD"; char osrelease[] = "3.0-19980416"; int osreldate = 300001; char sccs[4] = { '@', '(', '#', ')' }; char version[] = "DATAPLEX #4: 04/18/98\n"; shrimp: {66} cat ~library/bin/do-CVSUP #!/bin/sh /usr/local/sbin/cvsup supfile.cvsup TODAY=`date +%C%y%m%d` cat >/usr/src/.timestamp < SNAPDATE="`sed "s/#define FreeBSD_Source_Timestamp //" RELEASE="${REVISION}-${SNAPDATE}" 85c85 < v=`cat version` u=${USER-root} d=`pwd` h=`hostname` t=`date` --- > v=`cat version` u=${USER-root} d=`pwd` h=`hostname` t=`date +%D` 93c93 < \"${VERSION} #${v}: ${t}\\n ${u}@${h}:${d}\\n\";" >>vers.c --- > \"$1 #${v}: ${t}\\n\";" >>vers.c Richard Wackerbarth To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message