svn commit: r226863 - head/sys/conf

Doug Barton dougb at FreeBSD.org
Thu Oct 27 20:44:28 UTC 2011


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


More information about the svn-src-all mailing list