Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Apr 1998 19:27:49 -0500 (CDT)
From:      rkw@Dataplex.Net
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   conf/6346: Patch to HELP track source dates
Message-ID:  <199804190027.TAA28547@shrimp.dataplex.net>

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

>Number:         6346
>Category:       conf
>Synopsis:       Kernel version strings need to relate to the source not the build
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 18 17:30:01 PDT 1998
>Last-Modified:
>Originator:     Richard Wackerbarth
>Organization:
The Digital Dataplex
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:

	Anyone building from stale sources

>Description:

	When someone reports a problem, there is always confusion because the date that
	they BUILD a kernel is not a reliable indicator of the version of the source tree
	from which they built it.

>How-To-Repeat:

	Extract the sources from the CVS tree using some past date. Build a kernel.
	Note that the date in the version is the current date rather than the date
	of the sources. The kernel is actually much closer to matching one from
	many days ago rather than one produced from today's tree.

>Fix:
	
	Place a file in the tree that represents the date of the source tree rather than
	the current date.

	Until this is done, each user can approximate that date by locally building
	the file at the time that he updates their source.

	For Example: (Assuming that the CVSup server is up-to-date)
	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

	PATCH to conf/newvers.sh to utilize this file:
	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




	Please note that I intentionally use the #define construct so that it is possible
	to #include the file in a "C" program. It is much easier to strip off the unneeded
	portion in the shell script than it would be to attempt to generate the #define
	version at compile time.
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



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