From: Olof Johansson <olof@lixom.net>
To: yann.morin.1998@free.fr
Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
dvhart@linux.intel.com, john.stultz@linaro.org,
jwboyer@redhat.com, Olof Johansson <olof@lixom.net>
Subject: [PATCH 01/10] merge_config.sh: factor out value parsing
Date: Wed, 20 May 2015 15:00:51 -0700 [thread overview]
Message-ID: <1432159260-39390-2-git-send-email-olof@lixom.net> (raw)
In-Reply-To: <1432159260-39390-1-git-send-email-olof@lixom.net>
Since we want to adjust the line later on to deal with CONFIG_FOO=n,
let's make a function for it so we have only one place to change it in.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
scripts/kconfig/merge_config.sh | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index ec8e203..430d002 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -35,6 +35,10 @@ usage() {
echo " -O dir to put generated output files"
}
+getval() {
+ grep -w -e "$1" "$2"
+}
+
RUNMAKE=true
ALLTARGET=alldefconfig
WARNREDUN=false
@@ -104,8 +108,8 @@ for MERGE_FILE in $MERGE_LIST ; do
for CFG in $CFG_LIST ; do
grep -q -w $CFG $TMP_FILE || continue
- PREV_VAL=$(grep -w $CFG $TMP_FILE)
- NEW_VAL=$(grep -w $CFG $MERGE_FILE)
+ PREV_VAL=$(getval "$CFG" "$TMP_FILE")
+ NEW_VAL=$(getval "$CFG" "$MERGE_FILE")
if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then
echo Value of $CFG is redefined by fragment $MERGE_FILE:
echo Previous value: $PREV_VAL
@@ -145,8 +149,8 @@ make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
# Check all specified config values took (might have missed-dependency issues)
for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do
- REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE)
- ACTUAL_VAL=$(grep -w -e "$CFG" $OUTPUT/.config)
+ REQUESTED_VAL=$(getval "$CFG" "$TMP_FILE")
+ ACTUAL_VAL=$(getval "$CFG" "$OUTPUT/.config")
if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then
echo "Value requested for $CFG not in final .config"
echo "Requested value: $REQUESTED_VAL"
--
1.7.10.4
next prev parent reply other threads:[~2015-05-20 22:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-20 22:00 Olof Johansson
2015-05-20 22:00 ` Olof Johansson [this message]
2015-05-20 22:00 ` [PATCH 02/10] merge_config.sh: print warnings on stderr Olof Johansson
2015-05-20 22:00 ` [PATCH 03/10] merge_config.sh: minor argument parsing refactoring Olof Johansson
2015-05-20 22:00 ` [PATCH 04/10] merge_config.sh: exit non-0 in case of failures Olof Johansson
2015-05-20 22:00 ` [PATCH 05/10] merge_config.sh: Better handling of CONFIG_FOO=n Olof Johansson
2015-05-20 22:00 ` [PATCH 06/10] merge_config.sh: only consider last value of symbols Olof Johansson
2015-05-20 22:00 ` [PATCH 07/10] merge_config.sh: add tests Olof Johansson
2015-05-20 22:00 ` [PATCH 08/10] merge_config.sh: use trap for cleanup Olof Johansson
2015-05-20 22:00 ` [PATCH 09/10] merge_config.sh: allow single configs to be passed in on cmdline Olof Johansson
2015-05-20 22:01 ` [PATCH 10/10] merge_config.sh: add tests for cmdline configs Olof Johansson
2015-10-28 0:42 [PATCH 00/10] merge_config misc reworks and testcases Olof Johansson
2015-10-28 0:42 ` [PATCH 01/10] merge_config.sh: factor out value parsing Olof Johansson
2015-10-28 5:24 ` Darren Hart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1432159260-39390-2-git-send-email-olof@lixom.net \
--to=olof@lixom.net \
--cc=dvhart@linux.intel.com \
--cc=john.stultz@linaro.org \
--cc=jwboyer@redhat.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yann.morin.1998@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®