scripts: kconfig.py: Use err() helper for warnings-turned-errors

De-spams the code a bit.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
Ulf Magnusson 2019-11-16 05:08:24 +01:00 committed by Carles Cufí
commit 7a531ea22b

View file

@ -91,13 +91,10 @@ def main():
# now as well. # now as well.
for warning in kconf.warnings: for warning in kconf.warnings:
if fatal(warning): if fatal(warning):
sys.exit("\n" + textwrap.fill( err("""\
"Error: Aborting due to non-whitelisted Kconfig " Aborting due to non-whitelisted Kconfig warning '{}'. If this warning doesn't
"warning '{}'.\nNote: If this warning doesn't point " point to an actual problem, you can add it to the whitelist at the top of {}.\
"to an actual problem, you can add it to the " """.format(warning, sys.argv[0]))
"whitelist at the top of {}."
.format(warning, sys.argv[0]),
100) + "\n")
# Write the merged configuration and the C header # Write the merged configuration and the C header
print(kconf.write_config(args.dotconfig)) print(kconf.write_config(args.dotconfig))