From owner-freebsd-bugs@FreeBSD.ORG Thu May 1 10:10:00 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6B15A8F for ; Thu, 1 May 2014 10:10:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93F811793 for ; Thu, 1 May 2014 10:10:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s41AA0ui071414 for ; Thu, 1 May 2014 10:10:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s41AA0LG071413; Thu, 1 May 2014 10:10:00 GMT (envelope-from gnats) Resent-Date: Thu, 1 May 2014 10:10:00 GMT Resent-Message-Id: <201405011010.s41AA0LG071413@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mark Willson 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 ESMTPS id 79439A84 for ; Thu, 1 May 2014 10:09:33 +0000 (UTC) Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 672E3178D for ; Thu, 1 May 2014 10:09:33 +0000 (UTC) Received: from cgiserv.freebsd.org ([127.0.1.6]) by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s41A9X2B011899 for ; Thu, 1 May 2014 10:09:33 GMT (envelope-from nobody@cgiserv.freebsd.org) Received: (from nobody@localhost) by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s41A9X8l011898; Thu, 1 May 2014 10:09:33 GMT (envelope-from nobody) Message-Id: <201405011009.s41A9X8l011898@cgiserv.freebsd.org> Date: Thu, 1 May 2014 10:09:33 GMT From: Mark Willson To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: misc/189180: Show Last Changed Rev in uname -a output X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 10:10:00 -0000 >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@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@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: