Commit 00f84ffa authored by Łukasz Nowak's avatar Łukasz Nowak Committed by Kazuhiko Shiozaki

Chomp ../ from beginging of filenames.

In order to have as canonical as possible paths, chomp ../ from filenames and
recalculate base.
parent edbf9fb7
...@@ -1560,6 +1560,11 @@ def _open(base, filename, seen, dl_options, override, downloaded): ...@@ -1560,6 +1560,11 @@ def _open(base, filename, seen, dl_options, override, downloaded):
Recursively open other files based on buildout options found. 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) _update_section(dl_options, override)
_dl_options = _unannotate_section(dl_options.copy()) _dl_options = _unannotate_section(dl_options.copy())
newest = bool_option(_dl_options, 'newest', 'false') newest = bool_option(_dl_options, 'newest', 'false')
......
...@@ -457,12 +457,30 @@ used: ...@@ -457,12 +457,30 @@ used:
... extends = %sbase.cfg ... extends = %sbase.cfg
... bar = foo ... bar = foo
... """ % server_url) ... """ % 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', """\ >>> write('buildout.cfg', """\
... [buildout] ... [buildout]
... extends-cache = cache ... extends-cache = cache
... newest = true ... newest = true
... extends = %sbaseA.cfg %sbaseB.cfg ... extends = %sbaseA.cfg %sbaseB.cfg %sbaseC.cfg %sdeeper/base.cfg
... """ % (server_url, server_url)) ... """ % (server_url, server_url, server_url, server_url))
>>> print_(system(buildout + " -n")) >>> print_(system(buildout + " -n"))
Unused options for buildout: 'bar' 'foo'. Unused options for buildout: 'bar' 'foo'.
...@@ -480,6 +498,10 @@ a better solution would re-use the logging already done by the utility.) ...@@ -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/baseA.cfg was downloaded.
The URL http://localhost/base.cfg was downloaded. The URL http://localhost/base.cfg was downloaded.
The URL http://localhost/baseB.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. Not upgrading because not running a local buildout command.
Unused options for buildout: 'bar' 'foo'. 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