Commit 66023b81 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Julien Muchembled

Fix a bug where slapos.libnetworkcache is lost when buildout script is upgraded.

parent 44e5bc96
...@@ -1085,8 +1085,16 @@ class Buildout(DictMixin): ...@@ -1085,8 +1085,16 @@ class Buildout(DictMixin):
if not self.newest: if not self.newest:
return return
distributions = ['zc.buildout', 'setuptools']
try:
import slapos.libnetworkcache
except ImportError:
pass
else:
distributions.append('slapos.libnetworkcache')
ws = zc.buildout.easy_install.install( ws = zc.buildout.easy_install.install(
('zc.buildout', 'setuptools'), distributions,
self['buildout']['eggs-directory'], self['buildout']['eggs-directory'],
links = self['buildout'].get('find-links', '').split(), links = self['buildout'].get('find-links', '').split(),
index = self['buildout'].get('index'), index = self['buildout'].get('index'),
...@@ -1095,7 +1103,7 @@ class Buildout(DictMixin): ...@@ -1095,7 +1103,7 @@ class Buildout(DictMixin):
) )
upgraded = [] upgraded = []
for project in 'zc.buildout', 'setuptools': for project in distributions:
req = pkg_resources.Requirement.parse(project) req = pkg_resources.Requirement.parse(project)
project_location = pkg_resources.working_set.find(req).location project_location = pkg_resources.working_set.find(req).location
if ws.find(req).location != project_location: if ws.find(req).location != project_location:
......
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