diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2015-03-13 09:21:41 +0300 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2015-03-24 18:48:44 +0300 |
commit | 3a975b8cfcbe026b535f83bde9a3c009bae214f9 (patch) | |
tree | f15341a6f0f32da859fa202ecb73fda5194ba65c /scripts/kconfig | |
parent | 371cfd4ff0611d8bc5d18bbb9cc6a2bc3d56cd3d (diff) | |
download | linux-3a975b8cfcbe026b535f83bde9a3c009bae214f9.tar.xz |
merge_config.sh: improve indentation
It is true that we do not want to move the code too far to the
right, but something like below is not preferred:
if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then
echo Value of $CFG is redefined by fragment $MERGE_FILE:
echo Previous value: $PREV_VAL
echo New value: $NEW_VAL
echo
elif [ "$WARNREDUN" = "true" ]; then
echo Value of $CFG is redundant by fragment $MERGE_FILE:
fi
To fix this, call "continue" if the "grep" command fails to find the
given CONFIG.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/kconfig')
-rwxr-xr-x | scripts/kconfig/merge_config.sh | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh index 88d89b2986db..56584b107bf8 100755 --- a/scripts/kconfig/merge_config.sh +++ b/scripts/kconfig/merge_config.sh @@ -103,20 +103,18 @@ for MERGE_FILE in $MERGE_LIST ; do CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE) for CFG in $CFG_LIST ; do - grep -q -w $CFG $TMP_FILE - if [ $? -eq 0 ] ; then - PREV_VAL=$(grep -w $CFG $TMP_FILE) - NEW_VAL=$(grep -w $CFG $MERGE_FILE) - if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then + grep -q -w $CFG $TMP_FILE || continue + PREV_VAL=$(grep -w $CFG $TMP_FILE) + NEW_VAL=$(grep -w $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 echo New value: $NEW_VAL echo - elif [ "$WARNREDUN" = "true" ]; then + elif [ "$WARNREDUN" = "true" ]; then echo Value of $CFG is redundant by fragment $MERGE_FILE: - fi - sed -i "/$CFG[ =]/d" $TMP_FILE fi + sed -i "/$CFG[ =]/d" $TMP_FILE done cat $MERGE_FILE >> $TMP_FILE done |