mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 07:28:54 +08:00
[Kconfig] Merge/diff fixes and added some FMUv5 targets
This commit is contained in:
committed by
Daniel Agar
parent
ea393b54d9
commit
82888d3320
@@ -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)
|
||||
|
||||
@@ -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]))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user