sys/conf/newvers.sh vs. subversion-1.7

Doug Barton dougb at FreeBSD.org
Tue Oct 25 20:55:33 UTC 2011


On 10/25/2011 13:23, Craig Rodrigues wrote:
> On Tue, Oct 25, 2011 at 1:07 PM, Doug Barton <dougb at freebsd.org> wrote:
>>
>> 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.
> 
> Hmmm, sounds like a disagreement to me.

"Disagreement" implies that you and I both have equally valid ideas, and
that we cannot agree on which one to use.

> I have read your concerns, but I don't fully
> understand why invoking "svn info ${SRCDIR}/sys",
> ignoring the output of "svn info", and then just
> checking its return status is a bad idea.

As I tried to explain previously, running one command, testing the
outcome, and then running another command if the first succeeded is a
bad idea if you can simply run the command you need to run in the first
place and parse *its* output. Obviously running 'svn info' first isn't
overwhelmingly expensive, so this isn't the most horrible idea ever
suggested for FreeBSD. However as a general principle we should be
trying to do the best we can, not only for its own sake, but as an
example to those who read and copy the code.

BTW, the rest of my analysis in my previous post is relevant here too.
If a bare 'svnversion' took a long time to return in a non-svn directory
then obviously we'd have to give your solution a better look. However,
given that it returns nearly instantaneously, there's no point.

> Using "svnversion" further down in the script
> if "svn info" succeeds is all that I was recommending.

Yes, I understood what you were suggesting. :)

> Anyways, I am fine with the patch which you propose.

Awesome!

> The only possible issue could be in future,
> if svn switches from using decimal revision numbers
> to numbers which are in hexadecimal, base64, etc.
> 
> However, that is not currently the case, and if
> it does happen in future, we can change the script
> accordingly.

Actually hex would still work since 0x.... would match. :)

In any case I just tested the svn case, and it worked. If someone else
could test the non-svn case then we can get this fixed and move on.


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/



More information about the freebsd-current mailing list