tech-userlevel archive

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

Re: sh -e changes broke pkgsrc

On Mon, May 26, 2008 at 02:52:51PM +0100, Matthias Scheler wrote:
> I diasgree. Please have a look this change:
> It is an example of bad shell programming that got exposed by the "sh"  
> fixes.

As I suspected it was a case of broken shell code in "pkgsrc". It used
this construct with "set -e":

        while read type pattern dir; do                                 \
                ${TEST} "$$type" != "bootstrap" && continue;            \
                ${_DEPENDS_INSTALL_CMD};                                \

If "$$type" is "bootstrap" the whole ".. && ..." expression will evaluate
to false and the shell should terminate evaluation. The correct shell
code is:

        while read type pattern dir; do                                 \
                ${TEST} "$$type" = "bootstrap" || continue;             \
                ${_DEPENDS_INSTALL_CMD};                                \

> So please fix "pkgsrc" instead.

I did that:

I've test deinstalling, building and tar-ing a package. It works without
problems now.

I cannot tell for sure whether there are more examples of broken
shell code in "pkgsrc". But I would appreciate if people help me
fixing these instead of reverting the bug-fixes to "/bin/sh".

        Thanks in advance

Matthias Scheler                        

Home | Main Index | Thread Index | Old Index