annotations: compact more redundant arch and flavours settings
authorAndrea Righi <andrea.righi@canonical.com>
Wed, 16 Nov 2022 08:57:04 +0000 (09:57 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Wed, 16 Nov 2022 12:37:19 +0000 (13:37 +0100)
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
kconfig/annotations.py

index 490a6279304097b7553477213b58d1a7dc77f5eb..92d036f141ba25dee41756143eaf85661fc1fe3e 100644 (file)
@@ -152,7 +152,7 @@ class Annotation(Config):
                     continue
                 arch = m.group(1)
                 if arch not in self.config[conf]['policy']:
-                    continue
+                    self.config[conf]['policy'][arch] = self.config[conf]['policy'][flavour]
                 if self.config[conf]['policy'][flavour] == self.config[conf]['policy'][arch]:
                     del self.config[conf]['policy'][flavour]
 
@@ -183,7 +183,7 @@ class Annotation(Config):
                 new_val = self.config[conf]
                 if old_val != new_val:
                     if 'policy' in self.config[conf]:
-                        val = self.config[conf]['policy']
+                        val = dict(sorted(self.config[conf]['policy'].items()))
                         line = f"{conf : <47} policy<{val}>"
                         tmp.write(line + "\n")
                     if 'note' in self.config[conf]: