Commit 3c331745 authored by Łukasz Nowak's avatar Łukasz Nowak Committed by Julien Muchembled

Chomp ../ from beginging of filenames.

In order to have as canonical as possible paths, chomp ../ from filenames and
recalculate base.
parent f6a009e7
......@@ -1597,6 +1597,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 = bool_option(_dl_options, 'newest', 'false')
......
......@@ -457,12 +457,30 @@ used:
... extends = %sbase.cfg
... bar = foo
... """ % server_url)
>>> write(server_data, 'baseC.cfg', """\
... [buildout]
... extends-cache = cache
... extends = baseB.cfg
... bar = foo
... """)
>>> write(server_data, 'baseD.cfg', """\
... [buildout]
... extends-cache = cache
... 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
... """ % (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'.
......@@ -480,6 +498,10 @@ a better solution would re-use the logging already done by the utility.)
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/baseB.cfg was downloaded.
The URL http://localhost/deeper/base.cfg was downloaded.
The URL http://localhost/baseD.cfg was downloaded.
Not upgrading because not running a local buildout command.
Unused options for buildout: 'bar' 'foo'.
......
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