[M3devel] wierdness around user overrides vs. uname in sysinfo.sh?

Jay jayk123 at hotmail.com
Fri Dec 28 09:25:21 CET 2007


I wanted to change upgrade.sh to have the following features:

1) optionally skip building m3cc, since it is the slowest part

2) optionally clean between various steps, as was apparently necessary for me

I really cannot hack sh though. Sorry. I've tried several times through the years.
I just can't stand these languages where pretty much everything is a string.
e.g. sh, Tcl, cmd.
I admit hypocrisy in that I can and have hacked cmd.

So I started rewriting scripts/* in Python.
I'm not going to delete scripts/*.sh or anything THAT obnoxious (and get my
access revoked), just add a new scripts/python directory.
Tempting to call it scripts/jay.
I'm making good progess here.

Actually I started with Perl, which I have more experience with, but
it was frustrating and...

Anyway, so the real point here is, I'm reading scripts/* fairly closely.

I'd like to at times bounce my interpretation off folks.

In particular, I detect some wierdness.

Most variables can be set by the caller.
I assume that is mostly meant for the user to override things.
I agree that is mostly a good thing.

However it seems often data is derived, and then later overrides can kick in.

In particular, sysinfo.sh sets, e.g. M3OSTYPE and other data based on uname.
And it sets CM3_TARGET.
But TARGET is then set via the user override, or CM3_TARGET if no user override.

I draw one of two conclusions:

If a user sets TARGET, such as for a cross build, then user darn well better
set other variables manually to.

OR sysinfo.sh ought to check for TARGET being set, and derive data from that.
It should check preset TARGET or uname, not both.

I'm just going to leave it alone.

Presumably mostly the overrides are never set.
They are mainly for cross builds and/or bringing up new targets probably.

There aren't THAT MANY variables anyway.
Many could be removed, such as TAR, GREP, CM3*SEARCHPATH, etc.
Some are only for Win32.

Maybe after this I'll try rewriting scripts in Quake. :)

 - Jay

_________________________________________________________________
Get the power of Windows + Web with the new Windows Live.
http://www.windowslive.com?ocid=TXT_TAGHM_Wave2_powerofwindows_122007
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20071228/cff88c31/attachment-0001.html>


More information about the M3devel mailing list