[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: makeinfo fd leak? and gendocs.sh exit status bug

From: Eric Blake
Subject: Re: makeinfo fd leak? and gendocs.sh exit status bug
Date: Fri, 27 Mar 2009 06:51:07 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090302 Thunderbird/ Mnenhy/

Hash: SHA1

According to Karl Berry on 1/12/2009 5:22 PM:
>     Meanwhile, even after that message, gendocs.sh ran to completion
>     with an exit status of 0, so someone is failing to propogate the
>     error status properly.
> I thought it was more useful to have the script generate everything it
> could, even if errors, for the sake of debugging/etc.  But if you think
> it's better to use sh -e, I can be persuaded.

sh -e is a portability nightmare.  The POSIX folks just had a debate about
how it should behave, with the conclusion that almost every shell out
there has a different interpretation of the older ambiguous requirements.
 There is a proposal for wording for how it will behave, based on ksh88's
handling (as that seemed to be the least controversial, and matches the
intent, even if not the wording, of the original POSIX specification for
set -e).  With the new wording, the hope is that future implementations
will be consistent, but even then, the definition still has surprises:

Application writers should avoid relying on set -e within
    functions.  For example, in the following script:

        set -e
        start() {
           echo some-server started successfully
        start || echo >&2 some-server failed

    the -e setting is ignored within the function body (because the
    function is a command in an AND-OR list other than the last).
    Therefore if some-server fails, the function carries on to
    echo "server started successfully", and the exit status of the
    function is zero (which means "server failed" is not output).

So since gendocs.sh uses shell functions, set -e might not be the best
idea.  I'd still like to see the overall exit status be non-zero if any of
the intermediate steps fail, even though I do like the fact that it tries
all formats in spite of failures.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


reply via email to

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