From owner-svn-src-all@FreeBSD.ORG Thu Aug 8 15:59:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5F67FCB2; Thu, 8 Aug 2013 15:59:01 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3306A2E94; Thu, 8 Aug 2013 15:59:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r78Fx1dH034579; Thu, 8 Aug 2013 15:59:01 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r78Fx1h6034578; Thu, 8 Aug 2013 15:59:01 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201308081559.r78Fx1h6034578@svn.freebsd.org> From: Glen Barber Date: Thu, 8 Aug 2013 15:59:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254094 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2013 15:59:01 -0000 Author: gjb Date: Thu Aug 8 15:59:00 2013 New Revision: 254094 URL: http://svnweb.freebsd.org/changeset/base/254094 Log: When newvers.sh is run, it is possible that the svnversion (or svnliteversion) in the current lookup path is not what was used to check out the tree. If an incompatible version is used, the svn revision number is not reported in uname(1). Run ${svnversion} on newvers.sh itself when evaluating if the svn(1) in use is compatible with the tree. Fallback to an empty ${svnversion} if necessary. With this change, svnliteversion from base is only used if no compatible svnversion is found, so with this change, the version of svn(1) from the ports tree is evaluated first. Requested by: many MFC after: 3 days X-MFC-To: stable/9, releng/9.2 only Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Thu Aug 8 11:53:47 2013 (r254093) +++ head/sys/conf/newvers.sh Thu Aug 8 15:59:00 2013 (r254094) @@ -88,19 +88,31 @@ v=`cat version` u=${USER:-root} d=`pwd` i=`${MAKE:-make} -V KERN_IDENT` compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep 'version') -if [ -x /usr/bin/svnliteversion ] ; then - svnversion=/usr/bin/svnliteversion -fi - for dir in /usr/bin /usr/local/bin; do if [ ! -z "${svnversion}" ] ; then break fi if [ -x "${dir}/svnversion" ] && [ -z ${svnversion} ] ; then - svnversion=${dir}/svnversion - break + # Run svnversion from ${dir} on this script; if return code + # is not zero, the checkout might not be compatible with the + # svnversion being used. + ${dir}/svnversion $(basename ${0}) >/dev/null 2>&1 + if [ $? -eq 0 ]; then + svnversion=${dir}/svnversion + break + fi fi done + +if [ -z "${svnversion}" ] && [ -x /usr/bin/svnliteversion ] ; then + /usr/bin/svnversion $(basename ${0}) >/dev/null 2>&1 + if [ $? -eq 0 ]; then + svnversion=/usr/bin/svnliteversion + else + svnversion= + fi +fi + for dir in /usr/bin /usr/local/bin; do if [ -x "${dir}/p4" ] && [ -z ${p4_cmd} ] ; then p4_cmd=${dir}/p4