UBUNTU: [Packaging] update annotations scripts

BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
This commit is contained in:
Andrea Righi
2023-11-21 10:44:16 +01:00
committed by Paolo Pisati
parent 9db3268417
commit 0b411127d2
+9
View File
@@ -213,6 +213,7 @@ class Annotation(Config):
configs = {**configs, **self.search_config(arch=arch, flavour=flavour).keys()}
# Import configs from the Kconfig object into Annotations
flavour_arg = flavour
if flavour is not None:
flavour = arch + f'-{flavour}'
else:
@@ -224,6 +225,14 @@ class Annotation(Config):
val = '-'
if conf in self.config:
if 'policy' in self.config[conf]:
# Add a TODO if a config with a note is changing and print
# a warning
old_val = self.search_config(config=conf, arch=arch, flavour=flavour_arg)
if old_val:
old_val = old_val[conf]
if val != old_val and "note" in self.config[conf]:
self.config[conf]['note'] = "TODO: update note"
print(f"WARNING: {conf} changed from {old_val} to {val}, updating note")
self.config[conf]['policy'][flavour] = val
else:
self.config[conf]['policy'] = {flavour: val}