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

Dirty way of libnetworkached activation of buildout.

parent da697e8e
...@@ -345,6 +345,12 @@ class Buildout(UserDict.DictMixin): ...@@ -345,6 +345,12 @@ class Buildout(UserDict.DictMixin):
# Get a base working set for our distributions that corresponds to the # Get a base working set for our distributions that corresponds to the
# stated desires in the configuration. # stated desires in the configuration.
distributions = ['setuptools', 'zc.buildout'] distributions = ['setuptools', 'zc.buildout']
try:
import slapos.libnetworkcache
except ImportError:
pass
else:
distributions.append('slapos.libnetworkcache')
if options.get('offline') == 'true': if options.get('offline') == 'true':
ws = zc.buildout.easy_install.working_set( ws = zc.buildout.easy_install.working_set(
distributions, options['executable'], distributions, options['executable'],
...@@ -368,7 +374,14 @@ class Buildout(UserDict.DictMixin): ...@@ -368,7 +374,14 @@ class Buildout(UserDict.DictMixin):
# Now copy buildout and setuptools eggs, and record destination eggs: # Now copy buildout and setuptools eggs, and record destination eggs:
entries = [] entries = []
for name in 'setuptools', 'zc.buildout': copy_list = ['setuptools', 'zc.buildout']
try:
import slapos.libnetworkcache
except ImportError:
pass
else:
copy_list.append('slapos.libnetworkcache')
for name in copy_list:
r = pkg_resources.Requirement.parse(name) r = pkg_resources.Requirement.parse(name)
dist = ws.find(r) dist = ws.find(r)
if dist.precedence == pkg_resources.DEVELOP_DIST: if dist.precedence == pkg_resources.DEVELOP_DIST:
......
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