Commit 580c41b9 authored by Łukasz Nowak's avatar Łukasz Nowak

Enable additional eggs support.

parent 5fc9f5c3
...@@ -57,6 +57,13 @@ class Rebootstrap: ...@@ -57,6 +57,13 @@ class Rebootstrap:
self.wanted_python = os.path.join(self.parts_directory, self.wanted_python = os.path.join(self.parts_directory,
self.python_section, relative_python) self.python_section, relative_python)
# support additional eggs
self.eggs = []
wanted_eggs = rebootstrap_section.get('eggs')
if wanted_eggs:
wanted_eggs = [q.strip() for q in wanted_eggs.split() if q.strip()]
self.eggs = wanted_eggs
def __call__(self): def __call__(self):
self.install_section() self.install_section()
self.reboot() self.reboot()
...@@ -77,18 +84,18 @@ Buildout will be restarted automatically to have this change applied. ...@@ -77,18 +84,18 @@ Buildout will be restarted automatically to have this change applied.
running_python=self.running_python) running_python=self.running_python)
self.logger.info(message) self.logger.info(message)
options = self.buildout['buildout'] options = self.buildout['buildout']
specs = ['zc.buildout'] self.wanted_eggs = ['zc.buildout']
# XXX: A lot of below code is took from zc.buildout.buildout.py:_maybe_upgrade # XXX: A lot of below code is took from zc.buildout.buildout.py:_maybe_upgrade
# which is code duplication issue, but even if newer buildout with needed # which is code duplication issue, but even if newer buildout with needed
# hooks will be released, this extension shall work on older ones # hooks will be released, this extension shall work on older ones
if zc.buildout.easy_install.is_distribute: if zc.buildout.easy_install.is_distribute:
specs.append('distribute') self.wanted_eggs.append('distribute')
else: else:
specs.append('setuptools') self.wanted_eggs.append('setuptools')
ws = zc.buildout.easy_install.install( ws = zc.buildout.easy_install.install(
[ [
(spec + ' ' + options.get(spec+'-version', '')).strip() (spec + ' ' + options.get(spec+'-version', '')).strip()
for spec in specs for spec in self.wanted_eggs
], ],
options['eggs-directory'], options['eggs-directory'],
links = options.get('find-links', '').split(), links = options.get('find-links', '').split(),
......
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