Re: [PATCH] kconfig: Add merge_config.sh script

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

 



Hi,

On Mon, Nov 21, 2011 at 5:48 PM, john stultz <johnstul@xxxxxxxxxx> wrote:
> On Sat, 2011-11-19 at 01:51 -0500, Arnaud Lacombe wrote:
>> You'll find below some more nits
>>
>> 1) bail out early on error.
>
> Actually, I spoke a little too soon.
>
> The set -e option causes us to bomb out if grep doesn't find a config
> option (grep returns 1 if nothing is found). So I'll have to drop that
> change for now.
>
because the way the return value of grep(1) is checked is bogus. It
should not be:

    grep -q -w $CFG $TMP_FILE
    if [ $? -eq 0 ] ; then
        ...
    fi

but:

    if grep -q -w $CFG $TMP_FILE ; then
        ...
    fi

that way, you can still keep the `set -e'. IMHO, it should be set by
default for any shell script, just as a safety net, as `set -u'.

 - Arnaud
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux