[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1541145151-7319-1-git-send-email-yamada.masahiro@socionext.com>
Date: Fri, 2 Nov 2018 16:52:31 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: linux-kbuild@...r.kernel.org
Cc: Petr Vorel <petr.vorel@...il.com>,
Nasser <afshin.nasser@...il.com>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] kconfig: merge_config: avoid false positive matches from comment lines
The current SED_CONFIG_EXP could match to comment lines in config
fragment files, especially when CONFIG_PREFIX_ is empty. For example,
Buildroot uses empty prefixing; starting symbols with BR2_ is just
convention.
Make the sed expression more robust against false positives from
comment lines. The new sed expression matches to config options
followed by '=' or ' is not set'.
Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
---
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 7067a9f..180b523 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -103,7 +103,7 @@ if [ ! -r "$INITFILE" ]; then
fi
MERGE_LIST=$*
-SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(${CONFIG_PREFIX}[a-zA-Z0-9_]*\)[= ].*/\2/p"
+SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(${CONFIG_PREFIX}[a-zA-Z0-9_]*\)\(=.*\| is not set$\)/\2/p"
TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
--
2.7.4
Powered by blists - more mailing lists