From 23608e6132afb3f5d971da78a6283c349fe1eb8d Mon Sep 17 00:00:00 2001 From: Andrea Righi Date: Thu, 25 May 2023 18:59:10 +0200 Subject: [PATCH] annotations: never drop configs that have notes different than the parent Signed-off-by: Andrea Righi --- kconfig/annotations.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/kconfig/annotations.py b/kconfig/annotations.py index b521bd0..078dcf2 100644 --- a/kconfig/annotations.py +++ b/kconfig/annotations.py @@ -338,15 +338,16 @@ class Annotation(Config): if 'policy' not in new_val: continue - # If new_val is a subset of old_val, skip it + # If new_val is a subset of old_val, skip it unless there are + # new notes that are different than the old ones. old_val = tmp_a.config.get(conf) if old_val and 'policy' in old_val: - try: - if old_val['policy'] == old_val['policy'] | new_val['policy']: - continue - except TypeError: - if old_val['policy'] == {**old_val['policy'], **new_val['policy']}: + if old_val['policy'] == old_val['policy'] | new_val['policy']: + if not 'note' in new_val: continue + if 'note' in old_val and 'note' in new_val: + if old_val['note'] == new_val['note']: + continue # Write out the policy (and note) line(s) val = dict(sorted(new_val['policy'].items())) -- 2.31.1