Re: [CFT] [sys/conf/newvers.sh] Cleanup and additions.

From: jhell <jhell_at_dataix.net>
Date: Wed, 11 Aug 2010 07:50:43 -0400
On 08/11/2010 03:47, Oliver Fromme wrote:
> jhell <jhell_at_dataix.net> wrote:
>  > Based on the parts of the script with the additions for tracking source
>  > using git(1) I set out to add support for mercurial hg(1) and ended up
>  > cleaning some of the script while making some of those additions.
>  > [...]
>  > I have opened a PR: misc/149510 here: http://bit.ly/buBqXc
> 
> Just out of curiosity, why are you obfuscating this if statement?
> 
> -if [ ! -r version ]
> -then
> -        echo 0 > version
> -fi
> +[ ! -r version ] && echo 0 >version
> 
> It should rather be fixed like this (FreeBSD standard is to put
> if...then on one line):
> 
> -if [ ! -r version ]
> -then
> +if [ ! -r version ]; then
> 

I originally did it that way but on a sheer whim since it was a simple
test and did not end up in being some big fancy line I changed it to
what it is now. I have no problem changing this back since its only just
a visual change & functionality would still be the same. It was just
easier on my eyes while reading it for some reason and did not see a
need for a multi-line statement.

> On a tangential note ...  I've been using a wrapper script
> for "make kernel" for ages, long before svn existed.  It
> adds the date of the checked-out sources to the release name,
> e.g. uname -rsm gives "FreeBSD 8.1-PRERELEASE-20100720 i386"
> on this machine.
> 
> http://people.freebsd.org/~olli/scripts/makekernel
> 

Thanks, Ill check this out. Writing before reading that script I have
been using a script to build the kernel too. It just set BRANCH_OVERRIDE
and whatever other CFLAGS and make flags I want with the addition of
looking at kern.smp.cpus and calculating the recommended value to use
when using '-j' plus an additional amount if needed.

> Best regards
>    Oliver
> 

Thank you Oliver.

-- 

 jhell,v
Received on Wed Aug 11 2010 - 09:50:47 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:06 UTC