Skip to content
Permalink
Browse files

kconfig.py: Use messages returned by load_config() and write_config()

load_config() and write_config() now return a message to print. This
message also says whether the configuration was loaded (replace=True) or
merged (replace=False), and whether the new .config is different from
the old (for write_config()).

Print the returned messages and remove some old print()s.

Also switch to an improved warning control API (the old one is still
supported, but might as well).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
  • Loading branch information...
ulfalizer authored and carlescufi committed Jun 3, 2019
1 parent e36e544 commit f46ebc3c97a031c41641336dc9a6183a5c6f6889
Showing with 9 additions and 10 deletions.
  1. +9 −10 scripts/kconfig/kconfig.py
@@ -31,18 +31,18 @@ def main():
print("Parsing Kconfig tree in " + args.kconfig_root)
kconf = Kconfig(args.kconfig_root, warn_to_stderr=False)

# Warn for assignments to undefined symbols
kconf.warn_assign_undef = True

# prj.conf may override settings from the board configuration, so disable
# warnings about symbols being assigned more than once
kconf.disable_override_warnings()
kconf.disable_redun_warnings()
# Warn for assignments to undefined symbols
kconf.enable_undef_warnings()
kconf.warn_assign_override = False
kconf.warn_assign_redun = False

for i, config in enumerate(args.conf_fragments):
print(("Loading {} as base" if i == 0 else "Merging {}")
.format(config))
print(kconf.load_config(args.conf_fragments[0]))
for config in args.conf_fragments[1:]:
# replace=False creates a merged configuration
kconf.load_config(config, replace=False)
print(kconf.load_config(config, replace=False))

# Print warnings for symbols whose actual value doesn't match the assigned
# value
@@ -89,8 +89,7 @@ def main():
100) + "\n")

# Write the merged configuration and the C header
kconf.write_config(args.dotconfig)
print("Configuration written to '{}'".format(args.dotconfig))
print(kconf.write_config(args.dotconfig))
kconf.write_autoconf(args.autoconf)

# Write the list of processed Kconfig sources to a file

0 comments on commit f46ebc3

Please sign in to comment.
You can’t perform that action at this time.