Commit 44ce8371 authored by Julien Muchembled's avatar Julien Muchembled

fixup! Apply += & -= in correct order with respect to extends

If a.cfg extends b.cfg and both contain [a],
it was already not possible for a.cfg:[a] to combine <= & +=.
But it worked when a.cfg:[a] does not extend anything, and
commit 161fb191 broke that.

The only proper way to solve all this seems to process <= before
+= & -=. But since processing <= while extending files would cause
other issues, we'd rather process +=&-= when initializing parts.
parent ba6dbbe6
......@@ -1985,9 +1985,16 @@ def _update_section(s1, s2):
return s1
def _update(d1, d2):
for section in d2:
# always call _update_section, so that += & -= are processed correctly
_update_section(d1.setdefault(section, {}), d2[section])
for section, d2 in d2.items():
if section in d1:
_update_section(d1[section], d2)
# XXX: In order to process to process += & -= correctly
# with respect to extends, we want to use _update_section
# even if d1 does not contain the section.
# However, this would break the only case where <= can be
# combined with += & -=.
d1[section] = d2 if '<' in d2 else _update_section({}, d2)
return d1
def _recipe(options):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment