Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp697114ybe; Mon, 2 Sep 2019 07:51:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqziew95Hkq80KPN4DO1smloEHueLP2Bv+mkTXUFoL03gQ9xnWU49MESd+ItzGG4/hYIefUB X-Received: by 2002:a17:902:9b90:: with SMTP id y16mr29794207plp.17.1567435861285; Mon, 02 Sep 2019 07:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567435861; cv=none; d=google.com; s=arc-20160816; b=eMNqC4j2mQT4h9pIZxZmd/LSWCnwu47i9KmFhy2k52JUF7VE+79TzeyeHW7+RyLbW9 4LQeIGFx7xaZEqvETkwtpxZpNI30f4RsVfwVMhG1M7G4kKCXe0ad+PFGfdJKhLUD35Pb smdiSr7D0KyLWsygqHkxkMb1xZVmbSsVfRmpuZDDzRbQztMvu8wxFE1qkc5yk2Yl+kbM Nql1EzTe2JXHyERDAnn3T1ivr2VNngQ2vrtfiSilaqUFD0/cbc0EEKXW2u61kf84CRIM //VDO/0NDmqvuKVe43PvGnV2IVQWIyX3/yzgJ7PZhXfQw2vwnE5SiEVwfVs8sS7K+ghT RBiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=KwdZHj9IXxvqDGGDM++mpJVN/HoTl496QOwoQ8doTik=; b=TvPmuBVLscNNP6PEbn0I4ky/oPmwowZL/TOSAVZemhcuY8DRLVQhHPnSPDH7tOMWPx pWRgV8rUOhRn+PeLWl7kWmodZDClWaBc0CsZtGdLE96VshtqVF2BrU9at1MgLiT67blI avXYxhGdJXXtLvkBJGnj3Hgj0vSDBKZISgobULAHJIgw+dxKJ/fpAPv2a0/j0EVHqx69 h957wRr/g5zJA+HJkoaBBWxexkn/1ClNcg0ranlccXxwdJVBY6wcuA2sRbLaijOprla3 6Nju9QSlTtOQJScAFtwPX8N1C65i+hLZjYkOT+nVP0krhrPqQUO91L0EJsj8SzVInEwb X7TQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3si12260302pgo.241.2019.09.02.07.50.45; Mon, 02 Sep 2019 07:51:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731665AbfIBOuA (ORCPT + 99 others); Mon, 2 Sep 2019 10:50:00 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:50672 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726382AbfIBOuA (ORCPT ); Mon, 2 Sep 2019 10:50:00 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gtucker) with ESMTPSA id 410DF272BD9 Subject: Re: [PATCH 1/1] merge_config.sh: ignore unwanted grep errors To: Jon Hunter , Masahiro Yamada , Mark Brown Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, linux-tegra References: <4f92e9b3a88e60c8b5962504d77bc596442b0a40.1567023309.git.guillaume.tucker@collabora.com> From: Guillaume Tucker Message-ID: <4dcc3258-8909-e2de-2836-378e8e39594a@collabora.com> Date: Mon, 2 Sep 2019 15:49:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/09/2019 15:32, Jon Hunter wrote: > > On 02/09/2019 15:26, Guillaume Tucker wrote: >> On 02/09/2019 15:21, Jon Hunter wrote: >>> >>> On 02/09/2019 15:14, Guillaume Tucker wrote: >>>> + Jon Hunter who hit a similar issue >>> >>> Thanks for adding me. >>> >>>> On 28/08/2019 21:19, Guillaume Tucker wrote: >>>>> The merge_config.sh script verifies that all the config options have >>>>> their expected value in the resulting file and prints any issues as >>>>> warnings. These checks aren't intended to be treated as errors given >>>>> the current implementation. However, since "set -e" was added, if the >>>>> grep command to look for a config option does not find it the script >>>>> will then abort prematurely. >>>>> >>>>> Handle the case where the grep exit status is non-zero by setting >>>>> ACTUAL_VAL to an empty string to restore previous functionality. >>>>> >>>>> Fixes: cdfca821571d ("merge_config.sh: Check error codes from make") >>>>> Signed-off-by: Guillaume Tucker >>>>> --- >>>>> scripts/kconfig/merge_config.sh | 2 +- >>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>> >>>>> diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh >>>>> index d924c51d28b7..d673268d414b 100755 >>>>> --- a/scripts/kconfig/merge_config.sh >>>>> +++ b/scripts/kconfig/merge_config.sh >>>>> @@ -177,7 +177,7 @@ make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET >>>>> for CFG in $(sed -n -e "$SED_CONFIG_EXP1" -e "$SED_CONFIG_EXP2" $TMP_FILE); do >>>>> >>>>> REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE) >>>>> - ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG") >>>>> + ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG" || echo) >>> >>> Shouldn't this just be 'true' instead of 'echo'? >> >> I just explained why I used "echo" on your thread. Essentially, >> I think both can be used but "echo" made more sense to me because >> the script is then using the output string from the command >> rather than the exit status. > > Yes just saw that. However, I don't think that using 'echo' is > necessary. The grep command does not output anything and so the variable > will essentially be an empty string, we just need to ensure that no > error is returned from the command. In cases such as these I always use > 'true' in conjunction with grep. Sure, that makes sense too. Your solution is arguably a bit simpler so I agree it would be better to use "true" here. I can submit a v2 with "true" if that helps, unless you prefer to send your version of the fix yourself? Also we're actually using this fix in KernelCI to test it on top of Mark's patch: https://github.com/kernelci/linux/commits/staging.kernelci.org so I can get it tested again with quite a few build variants using "true". It's kind of trivial but we need a working merge_config.sh anyway on that branch. Guillaume