Skip to contentSkip to conversation

merge_config.sh: Add option to display redundant configs

PATCH Applied John Stultz 3 participants 3 messages Mar 23, 2012 – Mar 30, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 merge_config.sh: Add option to display redundant configs

Provide a -r option to display when fragments contain redundant options. This is really useful when breaking apart a config into fragments, as well as cleaning up older fragments.

v2:
Now w/ spelling fixes! Thanks Darren!

---
 scripts/kconfig/merge_config.sh |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
scripts/kconfig/merge_config.sh +9 -0
index ceadf0e..ad8c76e 100755
@@ -31,10 +31,12 @@ usage() {
 	echo "  -h    display this help text"
 	echo "  -m    only merge the fragments, do not execute the make command"
 	echo "  -n    use allnoconfig instead of alldefconfig"
+	echo "  -r    list redundant entries when merging fragments"
 }
 
 MAKE=true
 ALLTARGET=alldefconfig
+WARNREDUN=false
 
 while true; do
 	case $1 in
@@ -52,6 +54,11 @@ while true; do
 		usage
 		exit
 		;;
+	"-r")
+		WARNREDUN=true
+		shift
+		continue
+		;;
 	*)
 		break
 		;;
@@ -79,6 +86,8 @@ for MERGE_FILE in $MERGE_LIST ; do
 			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
 			sed -i "/$CFG[ =]/d" $TMP_FILE
 		fi
Signature · 1 line
1.7.3.2.146.gca209
Acked-by on v1 2/2
#1 lore raw
Quoted 11 lines · John Stultz

Provide a -r option to display when fragments contain redundant options. This is really useful when breaking apart a config into fragments, as well as cleaning up older fragments.

v2:
Now w/ spelling fixes! Thanks Darren!

Quoted 42 lines
---
 scripts/kconfig/merge_config.sh |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
scripts/kconfig/merge_config.sh +9 -0
index ceadf0e..ad8c76e 100755
@@ -31,10 +31,12 @@ usage() {
 	echo "  -h    display this help text"
 	echo "  -m    only merge the fragments, do not execute the make command"
 	echo "  -n    use allnoconfig instead of alldefconfig"
+	echo "  -r    list redundant entries when merging fragments"
 }
 
 MAKE=true
 ALLTARGET=alldefconfig
+WARNREDUN=false
 
 while true; do
 	case $1 in
@@ -52,6 +54,11 @@ while true; do
 		usage
 		exit
 		;;
+	"-r")
+		WARNREDUN=true
+		shift
+		continue
+		;;
 	*)
 		break
 		;;
@@ -79,6 +86,8 @@ for MERGE_FILE in $MERGE_LIST ; do
 			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
 			sed -i "/$CFG[ =]/d" $TMP_FILE
 		fi
Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
Applied
#2 lore raw
In reply to John Stultz
Quoted 11 lines · John Stultz

Provide a -r option to display when fragments contain redundant options. This is really useful when breaking apart a config into fragments, as well as cleaning up older fragments.

v2:
Now w/ spelling fixes! Thanks Darren!

Applied.

Quoted 17 lines
scripts/kconfig/merge_config.sh +6 -0
+WARNREDUN=false
 
 while true; do
 	case $1 in
@@ -52,6 +54,11 @@ while true; do
 		usage
 		exit
 		;;
+	"-r")
+		WARNREDUN=true
+		shift
+		continue
+		;;
 	*)
 		break
 		;;

scripts/kconfig/merge_config.sh for MERGE_FILE in $MERGE_LIST ; do · line 89

Quoted 4 lines
scripts/kconfig/merge_config.sh +1 -0
@@ -79,6 +86,8 @@ for MERGE_FILE in $MERGE_LIST ; do
 			echo Previous  value: $PREV_VAL
 			echo New value:       $NEW_VAL
 			echo
+			elif [ "$WARNREDUN" = "true" ]; then

If you are using true/false for flag variables, then you can simply say

elif $WARNREDUN; then

Michal