Adam Dinwoodie via Cygwin-apps writes:
> I think you've misunderstood how `set -e` works.

Likely, for some definition of "works".  I'm the last person to
understand bash, really.

[…]
> The issue is that the && chain disables `set -e` for anything other than
> the final command in the chain, *including within functions*.  In most
> functions in cygport, a non-zero return code will cause cygport to
> error, but because the && chain disables `set -e`, failures within
> src_install are silently ignored.  Counterintuitively, having the &&
> chain present means that execution will _continue_ after a failure!

Well, that's the short story, but the functions themselve can again
contain constructs that produce unexpected result now that "set -e" is
in effect, plus it'd depend on the call site of whether or not that is
true to begin with.  So in order to fix the problem you'd need to audit
all call sites…

> Alternatively, just have a look at the test case I attached to the cover
> email; I'd expect that cygport file to fail the install stage, because
> the first command in the src_install function is an unhandled failure.
> Currently, the src_install succeeds, with no hint of any problems, but
> with my patch, it produces an error as expected.

Given that it was the model for cygport, looking at Gentoo portage and
perticularly ebuild, you're probably right to expect that to happen.
However it seems that the Gentoo folks also stepped on that particular
mine in the past and have solved the problem in a different way by
moving the responsibility for the abort into the helper functions and
generally expecting "set +e" on entry (at the very least "-e" is _not_
set in toplevel).  I don't know enough about the further details of the
current implementation, but clearly by now it's way more complex than
what Yaakov took as the inspiration for cygport.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Q+, Q and microQ:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

Reply via email to