From: Andrea Righi Date: Thu, 25 May 2023 16:59:10 +0000 (+0200) Subject: annotations: never drop configs that have notes different than the parent X-Git-Tag: v0.1~21 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=23608e6132afb3f5d971da78a6283c349fe1eb8d;p=annotations.git annotations: never drop configs that have notes different than the parent Signed-off-by: Andrea Righi --- 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()))