Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Apr 1998 19:30:08 -0500
From:      Richard Wackerbarth <rkw@dataplex.net>
To:        Studded <Studded@san.rr.com>
Cc:        Greg Lehey <grog@lemis.com>, Karl Pielorz <kpielorz@tdx.co.uk>, current@FreeBSD.ORG
Subject:   Re: Quick Question re: Dmesg & Current Version
Message-ID:  <l03130300b15ee04e0d3c@[208.2.87.6]>
In-Reply-To: <35391FA6.79CA8363@san.rr.com>
References:  <353802A2.CB67FCE7@tdx.co.uk> <19980418113504.U1090@freebie.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <<EOF
#define FreeBSD_Source_Timestamp $TODAY
EOF


shrimp: {67} diff ../../conf/newvers.sh.old ../../conf/newvers.sh
41c41
< SNAPDATE=""
---
> SNAPDATE="`sed "s/#define FreeBSD_Source_Timestamp //" </usr/src/.timestamp`"
43c43
<       RELEASE="${RELEASE}-${SNAPDATE}"
---
>       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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?l03130300b15ee04e0d3c>