Current-Users 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:
> 
> http://mail-index.netbsd.org/pkgsrc-changes/2008/05/26/msg005942.html
> 
> 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};                                \
        done

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};                                \
        done

> So please fix "pkgsrc" instead.

I did that:

http://mail-index.netbsd.org/pkgsrc-changes/2008/05/26/msg005964.html

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                                  http://zhadum.org.uk/


Home | Main Index | Thread Index | Old Index