Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a975b8c authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Michal Marek
Browse files

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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
Reviewed-by: default avatarDarren Hart <dvhart@linux.intel.com>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent 371cfd4f
Loading
Loading
Loading
Loading
+6 −8
Original line number Original line Diff line number Diff line
@@ -103,8 +103,7 @@ for MERGE_FILE in $MERGE_LIST ; do
	CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE)
	CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE)


	for CFG in $CFG_LIST ; do
	for CFG in $CFG_LIST ; do
		grep -q -w $CFG $TMP_FILE
		grep -q -w $CFG $TMP_FILE || continue
		if [ $? -eq 0 ] ; then
		PREV_VAL=$(grep -w $CFG $TMP_FILE)
		PREV_VAL=$(grep -w $CFG $TMP_FILE)
		NEW_VAL=$(grep -w $CFG $MERGE_FILE)
		NEW_VAL=$(grep -w $CFG $MERGE_FILE)
		if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then
		if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then
@@ -116,7 +115,6 @@ for MERGE_FILE in $MERGE_LIST ; do
			echo Value of $CFG is redundant by fragment $MERGE_FILE:
			echo Value of $CFG is redundant by fragment $MERGE_FILE:
		fi
		fi
		sed -i "/$CFG[ =]/d" $TMP_FILE
		sed -i "/$CFG[ =]/d" $TMP_FILE
		fi
	done
	done
	cat $MERGE_FILE >> $TMP_FILE
	cat $MERGE_FILE >> $TMP_FILE
done
done