[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [CFT] Shell functionization patch (if you don't know what that means
Re: [CFT] Shell functionization patch (if you don't know what that means, it's faster Autoconf and leaner configure scripts)
Fri, 17 Oct 2008 09:02:43 +0200
* Paolo Bonzini wrote on Thu, Oct 16, 2008 at 06:38:19PM CEST:
> Also, the zsh issue has to be understood better (and could be a deal
> breaker, though I don't think so).
It basically means that you cannot call exit nor trap inside a shell
function. Nor can you use $? at the start of a function. But you'll
deal with that anyway since you will want to put something like
at the start of each function (either being empty, or 'set -x'), for
So, whenever you expand (or eval) arbitrary text into a shell function,
there is a potential problem. One possible solution is to split the
functionality in two function, a prepare and a postprocess one, and call
the arbitrary work outside.
I'm not quite sure how prevalent systems with this zsh are (but probably
still too common to completely ignore them). Even when we can ignore
them, the script header should be sure to error out for such systems
(because the corruption is silent, and hard to detect).