Commit bfa5cfcb authored by Xavier Thompson's avatar Xavier Thompson

WIP fix rebootstrap for buildout rebase

parent 2ad0a1f2
from setuptools import setup, find_packages
version = '4.5+xavier001'
version = '4.5.dev1'
name = "slapos.rebootstrap"
long_description = open("README.rst").read() + '\n\n'
......
......@@ -10,7 +10,7 @@ class FakeSysExecutable(object):
def get_distributions():
from pkg_resources import get_distribution
distributions = ['setuptools', 'zc.buildout']
distributions = ['setuptools', 'zc.buildout', 'wheel', 'pip']
try:
import slapos.libnetworkcache
except ImportError:
......@@ -36,15 +36,18 @@ def setup_script(path, python=sys.executable):
easy_install.sys = sys
def main():
import shutil, subprocess, tempfile, zipfile
import shutil, subprocess, tempfile, zipfile, tarfile
eggs_dir = sys.argv[2]
cache = sys.argv[3]
# Install setuptools.
src = os.path.join(cache, sys.argv[4].replace('==', '-') + '.zip')
base = os.path.join(cache, sys.argv[4].replace('==', '-'))
tmp = tempfile.mkdtemp()
try:
with zipfile.ZipFile(src) as zip_file:
zip_file.extractall(tmp)
try:
with zipfile.ZipFile(base + '.zip') as zip_file:
zip_file.extractall(tmp)
except (IOError, OSError):
with tarfile.open(base + '.tar.gz') as tar_file:
tar_file.extractall(tmp)
src, = os.listdir(tmp)
subprocess.check_call((sys.executable, 'setup.py', '-q', 'bdist_egg',
'--dist-dir', tmp), cwd=os.path.join(tmp, src))
......
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