Commit 4b889785 authored by Jim Fulton's avatar Jim Fulton

- Fixed a bug that caused buildouts to fail when variable

  substitutions are used to name standard directories, as in::

[buildout]
    eggs-directory = ${buildout:directory}/develop-eggs
parent caa49d0f
...@@ -4,8 +4,17 @@ Status ...@@ -4,8 +4,17 @@ Status
Change History Change History
************** **************
1.1 (2008-07-19) 1.1.1 (2008-07-28)
================ ==================
- Fixed a bug that caused buildouts to fail when variable
substitutions are used to name standard directories, as in::
[buildout]
eggs-directory = ${buildout:directory}/develop-eggs
1.1.0 (2008-07-19)
==================
- Added a buildout-level unzip option tp change the default policy for - Added a buildout-level unzip option tp change the default policy for
unzipping zip-safe eggs. unzipping zip-safe eggs.
......
...@@ -128,8 +128,11 @@ class Buildout(UserDict.DictMixin): ...@@ -128,8 +128,11 @@ class Buildout(UserDict.DictMixin):
# used already (Gottfried Ganssauge) # used already (Gottfried Ganssauge)
buildout_section = data.get('buildout') buildout_section = data.get('buildout')
# Try to make sure we have absolute paths for standard directories. We do this # Try to make sure we have absolute paths for standard
# before doing substitutions, in case a one of these gets read by another section. # directories. We do this before doing substitutions, in case
# a one of these gets read by another section. If any
# variable references are used though, we leave it as is in
# _buildout_path.
if 'directory' in buildout_section: if 'directory' in buildout_section:
self._buildout_dir = buildout_section['directory'] self._buildout_dir = buildout_section['directory']
for name in ('bin', 'parts', 'eggs', 'develop-eggs'): for name in ('bin', 'parts', 'eggs', 'develop-eggs'):
...@@ -255,8 +258,10 @@ class Buildout(UserDict.DictMixin): ...@@ -255,8 +258,10 @@ class Buildout(UserDict.DictMixin):
os.chdir(options['directory']) os.chdir(options['directory'])
def _buildout_path(self, *names): def _buildout_path(self, name):
return os.path.join(self._buildout_dir, *names) if '${' in name:
return name
return os.path.join(self._buildout_dir, name)
def bootstrap(self, args): def bootstrap(self, args):
__doing__ = 'Bootstraping.' __doing__ = 'Bootstraping.'
......
...@@ -2444,6 +2444,19 @@ def pyc_and_pyo_files_have_correct_paths(): ...@@ -2444,6 +2444,19 @@ def pyc_and_pyo_files_have_correct_paths():
""" """
def dont_mess_with_standard_dirs_with_variable_refs():
"""
>>> write('buildout.cfg',
... '''
... [buildout]
... eggs-directory = ${buildout:directory}/develop-eggs
... parts =
... ''' % globals())
>>> print system(buildout),
"""
###################################################################### ######################################################################
def create_sample_eggs(test, executable=sys.executable): def create_sample_eggs(test, executable=sys.executable):
......
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