Commit 75930619 authored by Julien Muchembled's avatar Julien Muchembled Committed by Xavier Thompson

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

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 bb3ef930
......@@ -1985,11 +1985,16 @@ def _update_section(s1, s2):
return s1
def _update(d1, d2):
for section in d2:
for section, d2 in d2.items():
if section in d1:
d1[section] = _update_section(d1[section], d2[section])
_update_section(d1[section], d2)
else:
d1[section] = d2[section]
# 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