annotations: properly merge configs with includes
authorAndrea Righi <andrea.righi@canonical.com>
Mon, 5 Dec 2022 06:28:49 +0000 (07:28 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Mon, 5 Dec 2022 06:28:49 +0000 (07:28 +0100)
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
kconfig/annotations.py

index 7645fd1da807efbfa31f2e83b03ff1d2b7eb97f9..0225e9dcf66ec811bdb446650def7f6f3663649e 100644 (file)
@@ -103,10 +103,10 @@ class Annotation(Config):
                 if conf in config:
                     entry = config[conf]
                 else:
-                    entry = {}
+                    entry = {'policy': {}}
                 m = re.match(r'.*policy<(.*)>', line)
                 if m:
-                    entry['policy'] = literal_eval(m.group(1))
+                    entry['policy'] |= literal_eval(m.group(1))
                 m = re.match(r'.*note<(.*?)>', line)
                 if m:
                     entry['note'] = "'" + m.group(1).replace("'", '') + "'"