Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Oct 2011 20:44:28 +0000 (UTC)
From:      Doug Barton <dougb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r226863 - head/sys/conf
Message-ID:  <201110272044.p9RKiSmf024559@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dougb
Date: Thu Oct 27 20:44:28 2011
New Revision: 226863
URL: http://svn.freebsd.org/changeset/base/226863

Log:
  Fix svnversion for svn 1.7.x by not looking for .svn in ${SYSDIR} (since
  it no longer exists). Instead, run svnversion if we can find the binary
  and test that the output looks like a version string.
  
  Reviewed by:	discussion on -current@
  Tested by:	rodrigc for non-svn case (thanks!)

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==============================================================================
--- head/sys/conf/newvers.sh	Thu Oct 27 20:39:20 2011	(r226862)
+++ head/sys/conf/newvers.sh	Thu Oct 27 20:44:28 2011	(r226863)
@@ -88,7 +88,7 @@ v=`cat version` u=${USER:-root} d=`pwd` 
 i=`${MAKE:-make} -V KERN_IDENT`
 
 for dir in /bin /usr/bin /usr/local/bin; do
-	if [ -d "${SYSDIR}/.svn" -a -x "${dir}/svnversion" ] ; then
+	if [ -x "${dir}/svnversion" ] ; then
 		svnversion=${dir}/svnversion
 		break
 	fi
@@ -99,8 +99,12 @@ for dir in /bin /usr/bin /usr/local/bin;
 done
 
 if [ -n "$svnversion" ] ; then
-    echo "$svnversion"
-	svn=" r`cd ${SYSDIR} && $svnversion`"
+	echo "$svnversion"
+	svn=`cd ${SYSDIR} && $svnversion`
+	case "$svn" in
+	[0-9]*)	svn=" r${svn}" ;;
+	*)	unset svn ;;
+	esac
 fi
 
 if [ -n "$git_cmd" ] ; then



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