On Wed, 03 Jan 2007 22:07:54 +0000 Steve Long
<slong@rathaus.eclipse.co.uk> wrote:
| Ciaran you're right in that it was obvious you were joking. I'd like
| to ask: did you implement this?
History of the die function, probably containing inaccuracies:
In the really early days, it was called 'try', and it was prefix. You'd
do things like:
try make
and it would either work or explode. Except if you tried to use
environment variables, or quoting, or anything like that, in which case
you'd encounter problems.
Then agriffis invented the original die, along with assert (which no-one
seems to use these days...). It avoided the quoting and environment
problems with try, and it was good. However, it doesn't work inside
subshells, which is only a mild annoyance so long as you know your
shell scripting (which most devs don't...).
Then along came eselect (or eclectic, as it was known back then), which
had a requirement for considerably more complex shell scripting than
your typical ebuild. In particular, we *had* to support die inside
various $( ) and ( ) constructs. Sooooo...
I came up with this really nasty hack of a die function that first
tries using signals and then falls back to the exit. It works in
subshells under certain circumstances, but not in others. It also
printed much nicer backtraces than the original ebuild style die.
When creating Paludis, I based assert and die upon the eselect code
rather than the Portage code (but with tweaks to make them ebuild
compatible). Those innovations (the way the function works, not
the exact code) have now made their way back into Portage.
The problem... is that most people don't realise a) when they're
triggering a subshell, b) how die works (read the source, it's about
twenty lines) or c) how unix signals work. This is why it's dangerous to
claim that "die now works inside subshells" -- yes, it does work,
*sometimes*, but because of all the limitations imposed by signals, it
cannot be considered a complete solution.
| One thing bothers me tho: you must have known that you'd get that
| kind of response by now, surely? For a start a lot of the gentoo
| crowd seem to be US citizens, and they're typically a hard crowd when
| you start taking the piss out of their religion. On top of that you
| seem to have fallen out with a lot of devs in the past. Although from
| the archives you have put in a sh*t load of work, and personally I
| have agreed with much of what you have said, and the way you have
| said it *in context*, you gotta be aware that kind of joke wouldn't
| go down well.
Oh, I dunno. Most people appreciate it. Those that don't need to remove
the sticks from their asses. They're the same kind that get upset when
someone says "Happy Christmas". Taking them seriously only adds to the
problem.
--
Ciaran McCreesh
Mail : ciaranm at ciaranm.org
Web :
http://ciaranm.org/ Paludis is faster :
http://ciaranm.org/show_post.pl?post_id=61