newvers.sh: consider as modified SVN mixed revision and other cases

The newvers -R option is intended to include build metadata (e.g. user,
host, time) if the build is from an unmodified VCS tree. For subversion
it considered a trailing 'M' as an indication of a modified tree, and
any other version string as modified.

Also include mixed revision checkouts (e.g. 123:126), switched (123S)
and partial (123P) working copies as modified: the revision number is
insufficient to uniquely determine which source was used for the build.

Reported by:	gjb
Reviewed by:	gjb
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8853
This commit is contained in:
Ed Maste 2016-12-19 17:31:34 +00:00
parent a5636d2a3e
commit 7f582d6294

View File

@ -197,12 +197,17 @@ fi
if [ -n "$svnversion" ] ; then
svn=`cd ${SYSDIR} && $svnversion 2>/dev/null`
if expr "$svn" : ".*M" >/dev/null; then
modified=true
fi
case "$svn" in
[0-9]*) svn=" r${svn}" ;;
*) unset svn ;;
[0-9]*[MSP]|*:*)
svn=" r${svn}"
modified=true
;;
[0-9]*)
svn=" r${svn}"
;;
*)
unset svn
;;
esac
fi
@ -270,7 +275,7 @@ if [ -n "$hg_cmd" ] ; then
fi
include_metadata=true
while getopts r opt; do
while getopts rR opt; do
case "$opt" in
r)
include_metadata=