Commit 7c30a819 authored by Jim Fulton's avatar Jim Fulton

Fixed: relative-paths weren't honored when bootstrapping or upgrading

       (which is how the buildout script gets generated).
parent f21a26be
......@@ -4,6 +4,9 @@ Change History
2.0.0b1 (2013-01-??)
====================
Fixed: relative-paths weren't honored when bootstrapping or upgrading
(which is how the buildout script gets generated).
Fixed: initialization code wasn't included in interpeter scripts.
Fixed: macro inheritance bug, https://github.com/buildout/buildout/pull/37
......
......@@ -351,9 +351,15 @@ class Buildout(DictMixin):
# Create buildout script
ws = pkg_resources.WorkingSet(entries)
ws.require('zc.buildout')
options = self['buildout']
zc.buildout.easy_install.scripts(
['zc.buildout'], ws, sys.executable,
self['buildout']['bin-directory'])
self['buildout']['bin-directory'],
relative_paths = (
bool_option(options, 'relative-paths', False)
and options['directory']
or ''),
)
def _init_config(self, config_file, args):
print_('Creating %r.' % config_file)
......@@ -897,6 +903,10 @@ class Buildout(DictMixin):
zc.buildout.easy_install.scripts(
['zc.buildout'], ws, sys.executable,
self['buildout']['bin-directory'],
relative_paths = (
bool_option(options, 'relative-paths', False)
and options['directory']
or ''),
)
# Restart
......
......@@ -2751,6 +2751,37 @@ now works.
- python
"""
def bootstrap_honors_relative_paths():
"""
>>> working = tmpdir('working')
>>> cd(working)
>>> write('buildout.cfg',
... '''
... [buildout]
... parts =
... relative-paths = true
... ''')
>>> _ = system(buildout+' bootstrap')
>>> cat('bin', 'buildout')
#!/Users/jim/bin/python3.3
<BLANKLINE>
import os
<BLANKLINE>
join = os.path.join
base = os.path.dirname(os.path.abspath(os.path.realpath(__file__)))
base = os.path.dirname(base)
<BLANKLINE>
import sys
sys.path[0:0] = [
join(base, 'eggs/distribute-0.6.30-py2.7.egg'),
'/Users/jim/p/zc/buildout/2/src',
]
<BLANKLINE>
import zc.buildout.buildout
<BLANKLINE>
if __name__ == '__main__':
sys.exit(zc.buildout.buildout.main())
"""
######################################################################
......
......@@ -184,3 +184,51 @@ directory:
Not upgrading because not running a local buildout command.
>>> ls('bin')
.. The relative-paths option is honored:
>>> cd(sample_buildout)
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... find-links = %(new_releases)s
... index = %(new_releases)s
... parts = show-versions
... develop = showversions
... relative-paths = true
...
... [show-versions]
... recipe = showversions
... """ % dict(new_releases=new_releases))
>>> print_(system(buildout), end='')
Upgraded:
zc.buildout version 99.99,
distribute version 99.99;
restarting.
Generated script '/sample-buildout/bin/buildout'.
Develop: '/sample-buildout/showversions'
Unused options for buildout: 'relative-paths'.
Updating show-versions.
zc.buildout 99.99
distribute 99.99
>>> cat('bin', 'buildout')
#!/Users/jim/bin/python3.3
<BLANKLINE>
import os
<BLANKLINE>
join = os.path.join
base = os.path.dirname(os.path.abspath(os.path.realpath(__file__)))
base = os.path.dirname(base)
<BLANKLINE>
import sys
sys.path[0:0] = [
join(base, 'eggs/zc.buildout-99.99-py3.3.egg'),
join(base, 'eggs/distribute-99.99-py3.3.egg'),
]
<BLANKLINE>
import zc.buildout.buildout
<BLANKLINE>
if __name__ == '__main__':
sys.exit(zc.buildout.buildout.main())
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