Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Oct 2011 13:07:47 -0700
From:      Doug Barton <dougb@FreeBSD.org>
To:        Craig Rodrigues <rodrigc@crodrigues.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: sys/conf/newvers.sh vs. subversion-1.7
Message-ID:  <4EA71713.3020404@FreeBSD.org>
In-Reply-To: <CAG=rPVdS%2BPOJqATw7kmb0%2Bb9byp3r2Vp8o=ELRFj9K7rA1zpYA@mail.gmail.com>
References:  <20111020114844.GK59810@albert.catwhisker.org> <20111020122121.GL59810@albert.catwhisker.org> <201110211636.05917.jhb@freebsd.org> <20111025140000.GA8559@albert.catwhisker.org> <CAG=rPVdS%2BPOJqATw7kmb0%2Bb9byp3r2Vp8o=ELRFj9K7rA1zpYA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------090502000102020509020606
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 10/25/2011 12:43, Craig Rodrigues wrote:

> I know that Doug disagreed with me on this,

I didn't "disagree" with you. I pointed out that there is absolutely no
reason to run 2 separate commands. To put it more bluntly, I pointed out
why your suggestion is a bad idea.

I'm sorry to be so blunt but I'm getting really tired of people who
can't let go of bad ideas even when it's demonstrated conclusively why
they are bad. :)

> The alternative would be to run ${dir}/svnversion, and check the output
> of that command, making sure that the output starts with a number.

The attached implements that, and is almost certainly the right way to
go. It would be nice if someone could test it, and better if someone
else could commit it. I swore after the last time that I'd stay away
from that file precisely because of all the bikeshed stupidity that this
issue creates.


Doug

-- 

	Nothin' ever doesn't change, but nothin' changes much.
			-- OK Go

	Breadth of IT experience, and depth of knowledge in the DNS.
	Yours for the right price.  :)  http://SupersetSolutions.com/


--------------090502000102020509020606
Content-Type: text/plain;
 name="newvers.sh.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="newvers.sh.diff"

Index: newvers.sh
===================================================================
--- newvers.sh	(revision 226474)
+++ newvers.sh	(working copy)
@@ -88,7 +88,7 @@
 i=`${MAKE:-make} -V KERN_IDENT`
 
 for dir in /bin /usr/bin /usr/local/bin; do
-	if [ -d "${SYSDIR}/.svn" -a -x "${dir}/svnversion" ] ; then
+	if [ -x "${dir}/svnversion" ] ; then
 		svnversion=${dir}/svnversion
 		break
 	fi
@@ -99,8 +99,12 @@
 done
 
 if [ -n "$svnversion" ] ; then
-    echo "$svnversion"
-	svn=" r`cd ${SYSDIR} && $svnversion`"
+	echo "$svnversion"
+	svn=`cd ${SYSDIR} && $svnversion`
+	case "$svn" in
+	[0-9]*)	svn=" r${svn}" ;;
+	*)	unset svn ;;
+	esac
 fi
 
 if [ -n "$git_cmd" ] ; then

--------------090502000102020509020606--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4EA71713.3020404>