Commit 818082c4 authored by Łukasz Nowak's avatar Łukasz Nowak

Merge branch 'bug_717802'

parents e52a53c4 39442e5d
......@@ -1385,6 +1385,11 @@ def _open(base, filename, seen, dl_options, override, downloaded):
Recursively open other files based on buildout options found.
"""
counter = 0
while filename.startswith('../'):
filename = filename.replace('../', '', 1)
counter += 1
base = base.rsplit('/', counter)[0]
_update_section(dl_options, override)
_dl_options = _unannotate_section(dl_options.copy())
newest = _convert_bool('newest', _dl_options.get('newest', 'false'))
......
......@@ -463,18 +463,35 @@ used:
... extends = baseB.cfg
... bar = foo
... """)
>>> write(server_data, 'baseD.cfg', """\
... [buildout]
... extends-cache = cache
... extends = baseC.cfg
... bar = foo
... """)
>>> mkdir(server_data, 'deeper')
>>> write(server_data, 'deeper', 'base.cfg', """\
... [buildout]
... extends-cache = cache
... extends = ../baseD.cfg
... bar = foo
... """)
>>> write('buildout.cfg', """\
... [buildout]
... extends-cache = cache
... newest = true
... extends = %sbaseA.cfg %sbaseB.cfg %sbaseC.cfg
... """ % (server_url, server_url, server_url))
... extends = %sbaseA.cfg %sbaseB.cfg %sbaseC.cfg %sdeeper/base.cfg
... """ % (server_url, server_url, server_url, server_url))
>>> print system(buildout + " -n")
Unused options for buildout: 'bar' 'foo'.
(XXX We patch download utility's API to produce readable output for the test;
a better solution would utilise the logging already done by the utility.)
As one can see, even if profile is prefixed with ../ the canocial path is
calculated. Thanks to this paths for complex extend trees are downloaded only
once.
>>> import zc.buildout
>>> old_download = zc.buildout.download.Download.download
>>> def wrapper_download(self, url, md5sum=None, path=None):
......@@ -487,6 +504,8 @@ The URL http://localhost/baseA.cfg was downloaded.
The URL http://localhost/base.cfg was downloaded.
The URL http://localhost/baseB.cfg was downloaded.
The URL http://localhost/baseC.cfg was downloaded.
The URL http://localhost/deeper/base.cfg was downloaded.
The URL http://localhost/baseD.cfg was downloaded.
Unused options for buildout: 'bar' 'foo'.
>>> zc.buildout.download.Download.download = old_download
......
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