misc/189180: Show Last Changed Rev in uname -a output
Mark Willson
cdr.nil at gmail.com
Thu May 1 10:10:00 UTC 2014
>Number: 189180
>Category: misc
>Synopsis: Show Last Changed Rev in uname -a output
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Thu May 01 10:10:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator: Mark Willson
>Release: 10.0
>Organization:
>Environment:
FreeBSD topaz 10.0-RELEASE-p2 FreeBSD 10.0-RELEASE-p2 #0 r265136: Wed Apr 30 18\
:35:11 BST 2014 root at cobalt:/usr/obj/usr/src/sys/GENERIC i386
>Description:
uname -a displays a svn rev number which appears to be from the 'top' of the svn repository, not the latest revision in the current branch (releng/10.0 in my case).
With the attached patch the uname -a output would look like:
FreeBSD topaz 10.0-RELEASE-p2 FreeBSD 10.0-RELEASE-p2 #0 r265124: Wed Apr 30 18\
:35:11 BST 2014 root at cobalt:/usr/obj/usr/src/sys/GENERIC i386
Now it shows the actual revision for the -p2 update. This I would find useful; not sure how many other people would agree.
>How-To-Repeat:
make buildworld
>Fix:
Add -c argument to /usr/bin/svnliteversion, and extract release number.
See attached patch.
Patch attached with submission follows:
--- newvers_orig.sh 2014-05-01 09:13:28.000000000 +0100
+++ newvers.sh 2014-05-01 11:00:40.000000000 +0100
@@ -110,12 +110,11 @@
if [ -z "${svnversion}" ] && [ -x /usr/bin/svnliteversion ] ; then
/usr/bin/svnliteversion $(realpath ${0}) >/dev/null 2>&1
if [ $? -eq 0 ]; then
- svnversion=/usr/bin/svnliteversion
+ svnversion="/usr/bin/svnliteversion -c"
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
@@ -133,7 +132,7 @@
if [ -n "$svnversion" ] ; then
svn=`cd ${SYSDIR} && $svnversion 2>/dev/null`
case "$svn" in
- [0-9]*) svn=" r${svn}" ;;
+ [0-9]*) svn=" r${svn#*:}" ;;
*) unset svn ;;
esac
fi
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list