[Top][All Lists]

[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

From: Ralf Wildenhues
Subject: Re: [CFT] Shell functionization patch (if you don't know what that means, it's faster Autoconf and leaner configure scripts)
Date: Fri, 17 Oct 2008 09:02:43 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hi Paolo,

* 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).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]