diff options
Diffstat (limited to 'scripts/kconfig/merge_config.sh')
-rwxr-xr-x[-rw-r--r--] | scripts/kconfig/merge_config.sh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh index ceadf0e150cf..974d5cb7e30a 100644..100755 --- a/scripts/kconfig/merge_config.sh +++ b/scripts/kconfig/merge_config.sh | |||
@@ -31,10 +31,12 @@ usage() { | |||
31 | echo " -h display this help text" | 31 | echo " -h display this help text" |
32 | echo " -m only merge the fragments, do not execute the make command" | 32 | echo " -m only merge the fragments, do not execute the make command" |
33 | echo " -n use allnoconfig instead of alldefconfig" | 33 | echo " -n use allnoconfig instead of alldefconfig" |
34 | echo " -r list redundant entries when merging fragments" | ||
34 | } | 35 | } |
35 | 36 | ||
36 | MAKE=true | 37 | MAKE=true |
37 | ALLTARGET=alldefconfig | 38 | ALLTARGET=alldefconfig |
39 | WARNREDUN=false | ||
38 | 40 | ||
39 | while true; do | 41 | while true; do |
40 | case $1 in | 42 | case $1 in |
@@ -52,18 +54,27 @@ while true; do | |||
52 | usage | 54 | usage |
53 | exit | 55 | exit |
54 | ;; | 56 | ;; |
57 | "-r") | ||
58 | WARNREDUN=true | ||
59 | shift | ||
60 | continue | ||
61 | ;; | ||
55 | *) | 62 | *) |
56 | break | 63 | break |
57 | ;; | 64 | ;; |
58 | esac | 65 | esac |
59 | done | 66 | done |
60 | 67 | ||
61 | 68 | INITFILE=$1 | |
69 | shift; | ||
62 | 70 | ||
63 | MERGE_LIST=$* | 71 | MERGE_LIST=$* |
64 | SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p" | 72 | SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p" |
65 | TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX) | 73 | TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX) |
66 | 74 | ||
75 | echo "Using $INITFILE as base" | ||
76 | cat $INITFILE > $TMP_FILE | ||
77 | |||
67 | # Merge files, printing warnings on overrided values | 78 | # Merge files, printing warnings on overrided values |
68 | for MERGE_FILE in $MERGE_LIST ; do | 79 | for MERGE_FILE in $MERGE_LIST ; do |
69 | echo "Merging $MERGE_FILE" | 80 | echo "Merging $MERGE_FILE" |
@@ -79,6 +90,8 @@ for MERGE_FILE in $MERGE_LIST ; do | |||
79 | echo Previous value: $PREV_VAL | 90 | echo Previous value: $PREV_VAL |
80 | echo New value: $NEW_VAL | 91 | echo New value: $NEW_VAL |
81 | echo | 92 | echo |
93 | elif [ "$WARNREDUN" = "true" ]; then | ||
94 | echo Value of $CFG is redundant by fragment $MERGE_FILE: | ||
82 | fi | 95 | fi |
83 | sed -i "/$CFG[ =]/d" $TMP_FILE | 96 | sed -i "/$CFG[ =]/d" $TMP_FILE |
84 | fi | 97 | fi |