Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jan 2002 17:40:41 +0000
From:      Josef Karthauser <joe@tao.org.uk>
To:        sheldonh@FreeBSD.org
Cc:        rkw@Dataplex.Net, freebsd-bugs@FreeBSD.org, joe@FreeBSD.org
Subject:   Re: conf/6346: Kernel version strings need to relate to the source not the build
Message-ID:  <20020130174041.B43943@genius.tao.org.uk>
In-Reply-To: <200201301602.g0UG2Fi73454@freefall.freebsd.org>; from sheldonh@FreeBSD.org on Wed, Jan 30, 2002 at 08:02:15AM -0800
References:  <200201301602.g0UG2Fi73454@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Wed, Jan 30, 2002 at 08:02:15AM -0800, sheldonh@FreeBSD.org wrote:
> Synopsis: Kernel version strings need to relate to the source not the build
> 
> State-Changed-From-To: feedback->open
> State-Changed-By: sheldonh
> State-Changed-When: Wed Jan 30 08:01:36 PST 2002
> State-Changed-Why: 
> Let's see if Joe bites. :-)
> 
> 
> Responsible-Changed-From-To: freebsd-bugs->joe
> Responsible-Changed-By: sheldonh
> Responsible-Changed-When: Wed Jan 30 08:01:36 PST 2002
> Responsible-Changed-Why: 
> Joe, could you work something into the CVS scripts to manage this file?

Bite bite.

Technically we could use the date in the latest $FreeBSD$ tag of the
source code, and then put this into vers.c at kernel build time.

The following patch would do it.

Joe

Index: newvers.sh
===================================================================
RCS file: /home/ncvs/src/sys/conf/newvers.sh,v
retrieving revision 1.47
diff -u -r1.47 newvers.sh
--- newvers.sh	2 Mar 2001 16:52:13 -0000	1.47
+++ newvers.sh	30 Jan 2002 17:39:42 -0000
@@ -86,11 +86,15 @@
 
 touch version
 v=`cat version` u=${USER-root} d=`pwd` h=`hostname` t=`date`
+
+l=`find /usr/src/sys/conf | xargs grep '\$FreeBSD:.*$' | sed \
+    's/.*\$FreeBSD://' | awk '{ print $3 "-" $4 }' | sort -n | tail -1`
+
 cat << EOF > vers.c
 $COPYRIGHT
 char sccspad[32 - 4 /* sizeof(sccs) */] = { '\\0' };
 char sccs[4] = { '@', '(', '#', ')' };
-char version[] = "${VERSION} #${v}: ${t}\\n    ${u}@${h}:${d}\\n";
+char version[] = "${VERSION}[${l}] #${v}: ${t}\\n    ${u}@${h}:${d}\\n";
 char ostype[] = "${TYPE}";
 char osrelease[] = "${RELEASE}";
 int osreldate = ${RELDATE};

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjxYMBkACgkQXVIcjOaxUBYwDgCg25mX6xvZwkhicsrZRSjghVLf
uGgAoMqn59GN0WTE5/vQshv2jCMUDzh1
=Hy0G
-----END PGP SIGNATURE-----

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