mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-23 11:43:24 +00:00
tool/update_btstack_config: support adding more than one define
This commit is contained in:
parent
481c0cbc48
commit
a9d074b9db
@ -33,15 +33,19 @@ def configuration_from_block(block, line_ending):
|
|||||||
if item in block:
|
if item in block:
|
||||||
block.remove(item)
|
block.remove(item)
|
||||||
|
|
||||||
|
defines_processed = []
|
||||||
for item in temp_defines_to_add:
|
for item in temp_defines_to_add:
|
||||||
if item in block:
|
if item in block:
|
||||||
temp_defines_to_add.remove(item)
|
defines_processed.append(item)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if len(block) > 0:
|
if len(block) > 0:
|
||||||
prefix = block[0].split("_")[0]
|
prefix = block[0].split("_")[0]
|
||||||
if item.startswith(prefix):
|
if item.startswith(prefix):
|
||||||
block.append(item)
|
block.append(item)
|
||||||
|
defines_processed.append(item)
|
||||||
|
|
||||||
|
for item in defines_processed:
|
||||||
temp_defines_to_add.remove(item)
|
temp_defines_to_add.remove(item)
|
||||||
|
|
||||||
block.sort()
|
block.sort()
|
||||||
@ -84,7 +88,8 @@ def read_and_update_configuration(full_path, line_ending):
|
|||||||
configuration += ("%s%s" % (line, line_ending))
|
configuration += ("%s%s" % (line, line_ending))
|
||||||
|
|
||||||
if len(temp_defines_to_add) > 0:
|
if len(temp_defines_to_add) > 0:
|
||||||
print("Cannot add defines: " % temp_defines_to_add)
|
print("Cannot add defines: \n- " + "\n- ".join(temp_defines_to_add))
|
||||||
|
print("ABORT")
|
||||||
sys.exit(10)
|
sys.exit(10)
|
||||||
|
|
||||||
# if end of file could not be detected, process last block
|
# if end of file could not be detected, process last block
|
||||||
|
Loading…
x
Reference in New Issue
Block a user