Commit 539e2232 authored by Patrick Strawderman's avatar Patrick Strawderman

fix macro "inheritance" bug.

parent 219b3b3e
...@@ -1117,7 +1117,7 @@ class Options(DictMixin): ...@@ -1117,7 +1117,7 @@ class Options(DictMixin):
raise zc.buildout.UserError("Infinite extending loop %r" % name) raise zc.buildout.UserError("Infinite extending loop %r" % name)
doing.append(name) doing.append(name)
try: try:
to_do = data.pop('<', None) to_do = data.get('<', None)
if to_do is None: if to_do is None:
return data return data
__doing__ = 'Loading input sections for %r', name __doing__ = 'Loading input sections for %r', name
...@@ -1133,6 +1133,7 @@ class Options(DictMixin): ...@@ -1133,6 +1133,7 @@ class Options(DictMixin):
result.update(self._do_extend_raw(iname, raw, doing)) result.update(self._do_extend_raw(iname, raw, doing))
result.update(data) result.update(data)
result.pop('<')
return result return result
finally: finally:
assert doing.pop() == name assert doing.pop() == name
......
...@@ -2715,6 +2715,40 @@ def want_new_zcrecipeegg(): ...@@ -2715,6 +2715,40 @@ def want_new_zcrecipeegg():
Error: Bad constraint >=2.0.0a3 zc.recipe.egg<2dev Error: Bad constraint >=2.0.0a3 zc.recipe.egg<2dev
""" """
def macro_inheritance_bug():
"""
There was a bug preventing a section from using another section as a macro
if that section was extended with macros, and both sections were listed as
parts (phew!). The following contrived example demonstrates that this
now works.
>>> write('buildout.cfg',
... '''
... [buildout]
... parts = foo bar
... [base]
... recipe = zc.recipe.egg
... [foo]
... <=base
... eggs = zc.buildout
... interpreter = python
... [bar]
... <=foo
... interpreter = py
... ''')
>>> print_(system(join('bin', 'buildout')), end='') # doctest: +ELLIPSIS
Installing foo.
...
Installing bar.
...
>>> ls("./bin")
- buildout
- py
- python
"""
###################################################################### ######################################################################
......
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