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

2010-08-11 Thread jhell
On 08/11/2010 03:47, Oliver Fromme wrote:
> jhell  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

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


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

2010-08-11 Thread jhell
On 08/10/2010 21:50, Anonymous wrote:
> Anonymous  writes:
> 
>> jhell  writes:
>>>
>>> And that would be to identify non-conforming ports using non-standard
>>> locations. Though the option is available to look in a non-standard
>>
>> You're confusing default and standard value. LOCALBASE has a default for
>> /usr/local. If it were a standard one wouldn't care about it and just
>> hardcode /usr/local everywhere.
> 
> ...or at least used `=' and not `?=' in bsd.port.mk.

The only mention I see of LOCALBASE in all of source on stable/8 is:
/usr/src/contrib/bind9/config.threads.in
/usr/src/secure/usr.bin/ssh/Makefile
/usr/src/secure/usr.sbin/sshd/Makefile
/usr/src/tools/kerneldoc/subsys/Makefile
/usr/src/tools/regression/atm/Funcs.sh
/usr/src/tools/regression/atm/proto_cc/RunTest.sh
/usr/src/tools/regression/atm/proto_sscfu/RunTest.sh
/usr/src/tools/regression/atm/proto_sscop/RunTest.sh
/usr/src/tools/regression/atm/proto_uni/RunTest.sh
/usr/src/tools/tools/tinybsd/CHANGES
/usr/src/usr.bin/make/Makefile

So what your telling me is we would have to pull in something else to do
this just for newvers.sh or is this sinking into the source from
somewhere I am not aware of?

-- 

 jhell,v

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


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

2010-08-11 Thread Oliver Fromme
jhell  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

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

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"We will perhaps eventually be writing only small modules which are identi-
fied by name as they are used to build larger ones, so that devices like
indentation, rather than delimiters, might become feasible for expressing
local structure in the source language." -- Donald E. Knuth, 1974
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


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

2010-08-10 Thread Anonymous
jhell  writes:

> On 08/10/2010 19:32, Anonymous wrote:
>> jhell  writes:
>> 
>>>  * Adjust the paths that are checked for binaries to be of only
>>> /usr/local/bin and /usr/bin. "/bin" is highly unlikely to hold svn(1),
>>> git(1) or hg(1).
>> 
>> Please, look at conf/146828. That script shouldn't blindly assume where
>> user installs his packages[1].
>> 
>> [1] using non-default LOCALBASE is a convenient way to identify
>> non-conforming ports
>> 
>
> And that would be to identify non-conforming ports using non-standard
> locations. Though the option is available to look in a non-standard

You're confusing default and standard value. LOCALBASE has a default for
/usr/local. If it were a standard one wouldn't care about it and just
hardcode /usr/local everywhere.

> location for binaries, IMHO it does not belong here and I don't find
> that right for building world. I also find this method a little hard to
> adjust for targeting specific locations, for example if the base system
> finally had a svnversion(1) installed and we prefered that over use of a
> local installed port. Currently I can just subtract that path from any
> one of the given SCM's configured to work with this patch without
> effecting the others.

Hmm, then just put LOCALBASE *after* /usr/bin in PATH.

  $ where grep
  /usr/local/bin/grep
  /usr/bin/grep
  $ find-bin grep
  $ echo $grep
  /usr/bin/grep

I don't think there is a need to cater ambiguity, i.e. having different
defaults for different programs.

>
> I have had another idea along the likes of this but just throwing an
> entry point hook in that checks for the existence of a user built or
> supplied file if you will so newvers.sh can keep doing what it has been
> doing for all these years without the interruption for small changes
> like the ones were talking about now. If people are interested in
> something like this I would be more than happy to oblige and provide a
> patch to do just that.

While hook is a good idea without working examples for popular VCSes
it'll not be very useful. One could add a script that tries to
binary-search for a svn revision based on cvsup checkout, too.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


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

2010-08-10 Thread jhell
On 08/10/2010 20:39, Doug Barton wrote:
> On 08/10/2010 17:34, jhell wrote:
>> I also meant to CC dougb@ on this as I believe he had something to do
>> with the original commits of the git(1) portions and possibly other parts.
> 
> I have specifically sworn off any further contact with that file. I have
> no idea why screwing around with what should have been a simple thing
> continues to hold such endless fascination for people, but I refuse to
> dive back into that swamp.
> 

I can respect that. I just find it to be of real use to be able to
identify what is currently running on the system to what revisions were
available at the time it was compiled whether it be local revisions or
remote or mixed like what I have done with this patch.

Personally I have drove off ideas of my own for a long time due to the
long standing nature and background of newvers.sh because it is just a
simple straight forward use that is needed from it. To complicate
something as simple as this just seems fundamentally wrong in a lot of
ways so I had to weigh the negatives and positives before I decided to
submit this one.


Regards & thanks for the good luck,

-- 

 jhell,v

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


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

2010-08-10 Thread Doug Barton
On 08/10/2010 17:34, jhell wrote:
> I also meant to CC dougb@ on this as I believe he had something to do
> with the original commits of the git(1) portions and possibly other parts.

I have specifically sworn off any further contact with that file. I have
no idea why screwing around with what should have been a simple thing
continues to hold such endless fascination for people, but I refuse to
dive back into that swamp.


Good luck,

Doug

-- 

Improve the effectiveness of your Internet presence with
a domain name makeover!http://SupersetSolutions.com/

Computers are useless. They can only give you answers.
-- Pablo Picasso

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


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

2010-08-10 Thread jhell
On 08/10/2010 19:32, Anonymous wrote:
> jhell  writes:
> 
>>  * Adjust the paths that are checked for binaries to be of only
>> /usr/local/bin and /usr/bin. "/bin" is highly unlikely to hold svn(1),
>> git(1) or hg(1).
> 
> Please, look at conf/146828. That script shouldn't blindly assume where
> user installs his packages[1].
> 
> [1] using non-default LOCALBASE is a convenient way to identify
> non-conforming ports
> 

And that would be to identify non-conforming ports using non-standard
locations. Though the option is available to look in a non-standard
location for binaries, IMHO it does not belong here and I don't find
that right for building world. I also find this method a little hard to
adjust for targeting specific locations, for example if the base system
finally had a svnversion(1) installed and we prefered that over use of a
local installed port. Currently I can just subtract that path from any
one of the given SCM's configured to work with this patch without
effecting the others.

I have had another idea along the likes of this but just throwing an
entry point hook in that checks for the existence of a user built or
supplied file if you will so newvers.sh can keep doing what it has been
doing for all these years without the interruption for small changes
like the ones were talking about now. If people are interested in
something like this I would be more than happy to oblige and provide a
patch to do just that.


>> +gitsvnid="`$git log |fgrep 'git-svn-id:' 
>> |head -1 |\
>> +sed -n 's/^...@\([0-9][0-9]*\).*$/\1/p'`"
> 
> The above line can be sed-only. A few parts can be simplified, too.
> 

I agree with this. I had just copied it over from what was already
existing and excepted by the original committee and whoever reviewed it.

I will adjust the patch for the sed(1) portion of this but I would
prefer to wait for further comments from the lists before adjusting the
search paths to use a function and look in a non-standard place.

I also meant to CC dougb@ on this as I believe he had something to do
with the original commits of the git(1) portions and possibly other parts.


Thank you for following up with me on this.

Regards,

-- 

 jhell,v

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"