diff options
author | dougb <dougb@FreeBSD.org> | 2011-10-27 20:44:28 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2011-10-27 20:44:28 +0000 |
commit | c8d6190f0fa357edc2cff2fcac61f38144096a6b (patch) | |
tree | 8c815eaf139790adc9e4af13c496f5c2629bfb15 /sys/conf/newvers.sh | |
parent | 6d7d535ac684ed4237c586a2767024ef553fd915 (diff) | |
download | FreeBSD-src-c8d6190f0fa357edc2cff2fcac61f38144096a6b.zip FreeBSD-src-c8d6190f0fa357edc2cff2fcac61f38144096a6b.tar.gz |
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!)
Diffstat (limited to 'sys/conf/newvers.sh')
-rw-r--r-- | sys/conf/newvers.sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 36be77f..55a644e 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -88,7 +88,7 @@ v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date` 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; do 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 |