svn commit: r254094 - head/sys/conf

Hiroki Sato hrs at FreeBSD.org
Thu Aug 8 17:04:33 UTC 2013


Glen Barber <gjb at FreeBSD.org> wrote
  in <201308081559.r78Fx1h6034578 at svn.freebsd.org>:

gj> Author: gjb
gj> Date: Thu Aug  8 15:59:00 2013
gj> New Revision: 254094
gj> URL: http://svnweb.freebsd.org/changeset/base/254094
gj>
gj> Log:
gj>   When newvers.sh is run, it is possible that the svnversion
gj>   (or svnliteversion) in the current lookup path is not what
gj>   was used to check out the tree.  If an incompatible version
gj>   is used, the svn revision number is not reported in uname(1).
gj>
gj>   Run ${svnversion} on newvers.sh itself when evaluating if the
gj>   svn(1) in use is compatible with the tree.  Fallback to an
gj>   empty ${svnversion} if necessary.
gj>
gj>   With this change, svnliteversion from base is only used
gj>   if no compatible svnversion is found, so with this change,
gj>   the version of svn(1) from the ports tree is evaluated first.
gj>
gj>   Requested by:	many
gj>   MFC after:	3 days
gj>   X-MFC-To:	stable/9, releng/9.2 only
gj>
gj> Modified:
gj>   head/sys/conf/newvers.sh
gj>
gj> Modified: head/sys/conf/newvers.sh
gj> ==============================================================================
gj> --- head/sys/conf/newvers.sh	Thu Aug  8 11:53:47 2013	(r254093)
gj> +++ head/sys/conf/newvers.sh	Thu Aug  8 15:59:00 2013	(r254094)
gj> @@ -88,19 +88,31 @@ v=`cat version` u=${USER:-root} d=`pwd`
gj>  i=`${MAKE:-make} -V KERN_IDENT`
gj>  compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep 'version')
gj>
gj> -if [ -x /usr/bin/svnliteversion ] ; then
gj> -	svnversion=/usr/bin/svnliteversion
gj> -fi
gj> -
gj>  for dir in /usr/bin /usr/local/bin; do
gj>  	if [ ! -z "${svnversion}" ] ; then
gj>  		break
gj>  	fi
gj>  	if [ -x "${dir}/svnversion" ] && [ -z ${svnversion} ] ; then
gj> -		svnversion=${dir}/svnversion
gj> -		break
gj> +		# Run svnversion from ${dir} on this script; if return code
gj> +		# is not zero, the checkout might not be compatible with the
gj> +		# svnversion being used.
gj> +		${dir}/svnversion $(basename ${0}) >/dev/null 2>&1
gj> +		if [ $? -eq 0 ]; then
gj> +			svnversion=${dir}/svnversion
gj> +			break
gj> +		fi
gj>  	fi
gj>  done
gj> +
gj> +if [ -z "${svnversion}" ] && [ -x /usr/bin/svnliteversion ] ; then
gj> +	/usr/bin/svnversion $(basename ${0}) >/dev/null 2>&1
gj> +	if [ $? -eq 0 ]; then
gj> +		svnversion=/usr/bin/svnliteversion
gj> +	else
gj> +		svnversion=
gj> +	fi
gj> +fi
gj> +

 I think this logic is unnecessarily complex.  svnversion does not
 need to run twice, at least.

 How about the attached patch?

-- Hiroki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: newvers.sh.20130809-1.diff
Type: text/x-patch
Size: 1770 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20130809/82a3ce14/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20130809/82a3ce14/attachment.sig>


More information about the svn-src-all mailing list