From: Andrea Righi Date: Tue, 3 Jan 2023 09:10:57 +0000 (+0100) Subject: annotations: remove configs that are undefined across all arches/flavours X-Git-Tag: v0.1~40 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=b495110ce9cfc3ba53ac7576892547614d75dd73;p=annotations.git annotations: remove configs that are undefined across all arches/flavours Sometimes certain config options are removed in new kernels, so when annotations is updated these options result to be undefined across all architectures and flavours, in this case it's much more clean to simply drop them from annotations (considering that the kernel doesn't support them anymore). Signed-off-by: Andrea Righi --- diff --git a/kconfig/annotations.py b/kconfig/annotations.py index e7eb423..20e7451 100644 --- a/kconfig/annotations.py +++ b/kconfig/annotations.py @@ -213,6 +213,10 @@ class Annotation(Config): for flavour in self.config[conf]['policy'].copy(): if flavour not in list(set(self.arch + self.flavour)): del self.config[conf]['policy'][flavour] + # Remove configs that are all undefined across all arches/flavours + if 'policy' in self.config[conf]: + if list(set(self.config[conf]['policy'].values())) == ['-']: + self.config[conf]['policy'] = {} # Drop empty rules if not self.config[conf]['policy']: del self.config[conf]