generic-build-script maintainership

Rafael Kitover caelum@debian.org
Thu Jan 22 23:32:00 GMT 2004


One thing I'd love to see in the generic-build-script, is:

set -e

instead of all the horrible && \ stuff. This would make it easier to indent,
reformat, add comments and greatly reduce the noise level. "set -e" works just
fine in both ash and bash. It can also be turned off and on in functions if
necessary.

Here's how it works:

Suppose you have:

-----------
#!/bin/sh

true
true
false
echo unreached...
------------

This prints "unreached...". Changint to:

-----------
#!/bin/sh

set -e

true
true
false
echo unreached...
-----------

Makes the script exit with status 1 at the "false" line.

It also works a bit like "use strict;" and -w in Perl, in that it forces
keeping track of commands in the script that exit with a non-zero status.

So in the artificial example above, if we don't want to exit at the false line,
something like:

false || true

works, and marks the command as possibly failing.

Anyway, just a pet peeve, feel free to ignore me :)

-- 
Rafael



More information about the Cygwin-apps mailing list