[lkml]   [2019]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH v2] ignore unwanted grep errors
The 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 (" Check error codes from make")
Signed-off-by: Guillaume Tucker <>
Cc: Jon Hunter <>

v2: use true rather than echo as per Jon Hunter's suggestion

scripts/kconfig/ | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/ b/scripts/kconfig/
index d924c51d28b7..f2cc10b1d404 100755
--- a/scripts/kconfig/
+++ b/scripts/kconfig/
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" || true)
if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then
echo "Value requested for $CFG not in final .config"
echo "Requested value: $REQUESTED_VAL"
 \ /
  Last update: 2019-09-02 17:19    [W:0.045 / U:6.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site