svn commit: r204824 - head/sys/conf

David O'Brien obrien at FreeBSD.org
Mon Mar 8 01:21:32 UTC 2010


On Sun, Mar 07, 2010 at 02:36:19PM -0700, M. Warner Losh wrote:
> Please back out this change.  It is unwise, I think.

Instead I'd rather fix it for the use case you mention.

---->%---->%---->%---->%---->%---->%---->%---->%---->%---->%---->%---->%----
Index: newvers.sh
===================================================================
--- newvers.sh	(revision 204851)
+++ newvers.sh	(working copy)
@@ -87,13 +87,11 @@ touch version
 v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date`
 i=`${MAKE:-make} -V KERN_IDENT`
 
+# Are we doing a kernel build?  Look for "/sys/" in pwd for 'make kernel',
+# and "/compile/" for tradiational within-tree kernel build.
 case "$d" in
-*/compile/*)
-	SRCDIR=${d##*obj}
-	if [ -n "$MACHINE" ]; then
-		SRCDIR=${SRCDIR##/$MACHINE}
-	fi
-	SRCDIR=$(cd ${SRCDIR%%/compile/*}/.. && pwd)
+*/sys/*|*/compile/*)
+	SRCDIR=$(realpath $(dirname $0)/..)
 
 	for dir in /bin /usr/bin /usr/local/bin; do
 		if [ -d "${SRCDIR}/.svn" -a -x "${dir}/svnversion" ] ; then
---->%---->%---->%---->%---->%---->%---->%---->%---->%---->%---->%---->%----


Do you get the subversion revision in your vers.c file with this patch?

-- 
-- David


More information about the svn-src-head mailing list