[M3devel] moving versions into simple text file (sh?)
Jay
jayk123 at hotmail.com
Sun Apr 20 16:26:34 CEST 2008
Right -- turning it into executable code is tempting, however what you show isn't quite the whole story.
Perhaps if the sed sticks default_ on the front or something.
How about:
> $ eval "`awk < $root/scripts/version '{print default_$1=$2}'`"
FOO=${FOO:$default_FOO}
BAR=${FOO:$default_BAR}
So then I am back to repeating every variable name three times, but hey at least I only run awk/sed once instead of three times. :)
I will try something like that.
The other code you shows was not understandable to me, alas.
I wasn't going to use $( ), but it does seem to be posix and nested ` bit me before.
So I've been reading about bash vs. sh vs. dash, and autoconfigure..and I learn that Solaris sh is pre-Posix and not conformant.
That /bin/sh isn't even where you get Posix sh from, according to Posix.
I am more and more convinced that the way to go "here" (not actually "here", not Modula-3 related, but GNU/Unix related) is a really small "portable" "thingy" that is used only to bootstrap the next level up which would be much richer. For example, a decent non-extensible single-threaded scripting language written in one large C file, that only used like stdio and/or open/read/write..
Then the "configure" script is really small:
configure-unix
#!/bin/sh
cc foo.c -o foo
if ! -f foo then
echo "C compilation failed, please see $0"
exit 1
end
./foo $0
And then write the rest in C, but the "script" can contain some "scripting language" for the C to interpret from there.
Write the above in .cmd/.bat and the VMS language and done.
Add some probes for the compiler name, cl, bcc, icc, dmc, etc.
I mean, all the gnarly workarounds in autoconf output, heck, can't bash be distilled down to a small portable useful base, that doesn't need configuring, and just use it without workarounds?
I just don't see much value in all the layers.. or I'm too lazy to keep learning more and more and more similar stuff full of history and cruft....
- Jay
----------------------------------------
> Date: Sun, 20 Apr 2008 09:05:25 +0100
> From: roland.illig at gmx.de
> To: m3devel at elegosoft.com
> Subject: Re: [M3devel] moving versions into simple text file (sh?)
>
> Roland Illig schrieb:
>> Jay schrieb:
>>> I'd like to (finally) move the default versions out into a simple file.
>>>
>>> Given:
>>>
>>> jbook15:/dev2/cm3/scripts jay$ cat version
>>> CM3VERSION d5.7.0
>>> CM3VERSIONNUM 050700
>>> CM3LASTCHANGED 2008-03-16
>
> or maybe this, which is even easier:
>
> $ eval "`sed 's, ,=,' $root/scripts/version`"
>
> Roland
More information about the M3devel
mailing list