[Kconfig] Merge/diff fixes and added some FMUv5 targets

This commit is contained in:
Peter van der Perk
2021-10-07 10:09:01 -04:00
committed by Daniel Agar
parent ea393b54d9
commit 82888d3320
12 changed files with 85 additions and 457 deletions
+2
View File
@@ -59,6 +59,8 @@ def print_config(op, config, value, new_value):
if merge_style:
if op=="-" and value=="y":
print("CONFIG_%s=n" % (config))
elif op=="-" and not new_value:
print("# CONFIG_%s is not set" % (config))
elif new_value:
if new_value=="n":
print("# CONFIG_%s is not set" % config)
+20
View File
@@ -72,6 +72,11 @@
from __future__ import print_function
import sys
import re
import pprint
def _re_match(regex):
return re.compile(regex, re.ASCII).match
from kconfiglib import Kconfig, BOOL, TRISTATE, TRI_TO_STR
@@ -99,6 +104,21 @@ kconf.warn_assign_redun = False
for config in sys.argv[3:]:
print(kconf.load_config(config, replace=False))
# Modification for PX4 unset all symbols (INT,HEX etc) from 2nd config
f = open(sys.argv[4], 'r')
unset_match = re.compile(r"# {}([^ ]+) is not set".format("CONFIG_"), re.ASCII).match
for line in f:
match = unset_match(line)
pprint.pprint(match)
if match is not None:
sym_name = match.group(1)
kconf.syms[sym_name].unset_value()
f.close()
# Write the merged configuration
print(kconf.write_config(sys.argv[2]))