bug-texinfo
[Top][All Lists]
Advanced

[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:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
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:
https://www.opengroup.org/sophocles/show_mail.tpl?CALLER=index.tpl&source=L&listname=austin-review-l&id=2655

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

        set -e
        start() {
           some-server
           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
-----BEGIN PGP SIGNATURE-----
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

iEYEARECAAYFAknMy7oACgkQ84KuGfSFAYDsiwCcDxj8Jbqhj5H6vvP6C13dVm7R
PN8An0IT90ba/K52Fk0kuIcvWrkx5IvQ
=Qk5a
-----END PGP SIGNATURE-----




reply via email to

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