Commit 71633373 authored by Łukasz Nowak's avatar Łukasz Nowak

Simplify and fix eggs support.

parent 580c41b9
...@@ -59,10 +59,10 @@ class Rebootstrap: ...@@ -59,10 +59,10 @@ class Rebootstrap:
# support additional eggs # support additional eggs
self.eggs = [] self.eggs = []
wanted_eggs = rebootstrap_section.get('eggs') eggs = rebootstrap_section.get('eggs')
if wanted_eggs: if eggs:
wanted_eggs = [q.strip() for q in wanted_eggs.split() if q.strip()] eggs = [q.strip() for q in eggs.split() if q.strip()]
self.eggs = wanted_eggs self.eggs = eggs
def __call__(self): def __call__(self):
self.install_section() self.install_section()
...@@ -84,18 +84,18 @@ Buildout will be restarted automatically to have this change applied. ...@@ -84,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']
self.wanted_eggs = ['zc.buildout'] self.eggs.append('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:
self.wanted_eggs.append('distribute') self.eggs.append('distribute')
else: else:
self.wanted_eggs.append('setuptools') self.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 self.wanted_eggs for spec in self.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