summaryrefslogtreecommitdiff
path: root/examples/merge_config.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-11-17 09:21:13 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2018-11-17 19:03:36 +0100
commitb65baa47f69ae4c3993876a7edf0da0075aa70ff (patch)
tree2f4c7b4c7b54c7a97ed125d488e27ab351f2bc96 /examples/merge_config.py
parenteb83890ae60be8509be1e42fe706d268e5b7f80d (diff)
Add support for KCONFIG_ALLCONFIG
This allows some symbol values to be forced while running all{def,no,yes,mod}config.py. See Documentation/kbuild/kconfig.txt in the Linux kernel. Add a helper function load_allconfig() to Kconfiglib to avoid code duplication in the tools. Also add functions for enabling/disabling the warning that's generated when a symbol is assigned multiple times in a (set of) .config files and the values differ. It should be disabled when merging the KCONFIG_ALLCONFIG configuration file. Previously, only the warning generated when the assigned values are identical could be disabled. Disable all warnings related to assigning a symbol multiple times in examples/merge_config.py as well.
Diffstat (limited to 'examples/merge_config.py')
-rw-r--r--examples/merge_config.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/merge_config.py b/examples/merge_config.py
index bcc627b..4b56cb8 100644
--- a/examples/merge_config.py
+++ b/examples/merge_config.py
@@ -77,6 +77,12 @@ kconf.enable_undef_warnings()
# set up here as well. The approach in examples/allnoconfig_simpler.py could
# provide an allnoconfig starting state for example.)
+# Disable warnings generated for multiple assignments to the same symbol within
+# a (set of) configuration files. Assigning a symbol multiple times might be
+# done intentionally when merging configuration files.
+kconf.disable_override_warnings()
+kconf.disable_redun_warnings()
+
# Create a merged configuration by loading the fragments with replace=False
for config in sys.argv[3:]:
kconf.load_config(config, replace=False)
@@ -109,6 +115,6 @@ for sym in kconf.defined_syms:
user_value = sym.user_value
if user_value != sym.str_value:
- print('warning: {} was assigned the value "{}" but got the '
- 'value "{}" -- check dependencies'
+ print("warning: {} was assigned the value '{}' but got the "
+ "value '{}' -- check dependencies"
.format(name_and_loc(sym), user_value, sym.str_value))