Commit fc7b9c40 authored by Xavier Thompson's avatar Xavier Thompson

WIP

parent 8a706982
......@@ -38,13 +38,9 @@ setup(
namespace_packages=['slapos'],
packages=find_packages(),
zip_safe=True,
dependency_links=[
#'http://www.nexedi.org/static/packages/source/slapos.buildout/',
'https://softinst182198.host.vifib.net/public/',
],
install_requires=[
'setuptools',
'zc.buildout==3.0.1+slapos002',
'zc.buildout',
],
extras_require=extras_require,
tests_require=extras_require['test'],
......
......@@ -17,7 +17,16 @@ import pkg_resources
from zc.buildout import easy_install, UserError
def get_paths():
class FakeSysExecutable(object):
def __init__(self, python):
self.executable = python
def __getattr__(self, attr):
return getattr(sys, attr)
def get_requirements():
specs = ['setuptools', 'zc.buildout', 'wheel', 'pip']
try:
import slapos.libnetworkcache
......@@ -25,7 +34,16 @@ def get_paths():
pass
else:
specs.append('slapos.libnetworkcache')
return [pkg_resources.get_distribution(spec).location for spec in specs]
return specs
def get_distributions():
return map(pkg_resources.get_distribution, get_requirements())
def get_paths():
paths = set(dist.location for dist in get_distributions())
return [path for path in sys.path if path in paths]
def setup_script(path, python=sys.executable):
......@@ -107,12 +125,13 @@ Buildout will be restarted automatically to have this change applied.
shutil.move(installed, installed + '-old')
try:
paths = get_paths()
args = [arg for arg in sys.argv if arg.startswith('buildout:')]
subprocess.check_call(
[self.wanted_python, '-c',
"import sys ; sys.path[0:0]=%r ; "
"import zc.buildout.buildout ; "
"sys.argv[1:1]=%r ; "
"zc.buildout.buildout.main()" % (paths, ['bootstrap'])])
"zc.buildout.buildout.main()" % (paths, args + ['bootstrap'])])
except subprocess.CalledProcessError:
shutil.move(installed + '-old', installed)
raise
......
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