Commit 084499b0 authored by Julien Muchembled's avatar Julien Muchembled

re6st: fix OBS packaging after the move to buildout 2

Since buildout 2 no longer supports using multiple versions of Python
in a single buildout, we're now forced to use slapos.rebootstrap.
parent 2f9bead0
...@@ -8,7 +8,7 @@ extends-cache = extends-cache ...@@ -8,7 +8,7 @@ extends-cache = extends-cache
download-cache = download-cache download-cache = download-cache
develop = develop =
extensions = extensions = slapos.rebootstrap
newest = false newest = false
parts += chrpath python parts += chrpath python
...@@ -17,8 +17,8 @@ parts += chrpath python ...@@ -17,8 +17,8 @@ parts += chrpath python
recipe = zc.recipe.egg recipe = zc.recipe.egg
interpreter = ${:_buildout_section_name_} interpreter = ${:_buildout_section_name_}
eggs = setuptools eggs = setuptools
python = buildout # https://lab.nexedi.com/nexedi/slapos.buildout/merge_requests/11
scripts = scripts = dummy
# Uguu, upstream buildout.cfg must be patched as it works the other way # Uguu, upstream buildout.cfg must be patched as it works the other way
# around from a packager point of view at least, thus at the end static # around from a packager point of view at least, thus at the end static
......
...@@ -31,4 +31,7 @@ for x in path: ...@@ -31,4 +31,7 @@ for x in path:
except OSError as e: except OSError as e:
if e.errno != errno.EEXIST: if e.errno != errno.EEXIST:
raise raise
shutil.copytree(x, d, True) if os.path.isdir(x):
shutil.copytree(x, d, True)
else:
shutil.copy2(x, d)
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
# If this way of packaging is reused for other software, postinst scripts # If this way of packaging is reused for other software, postinst scripts
# should be implemented. # should be implemented.
import os, rfc822, shutil, time, urllib import os, rfc822, shutil, ssl, time, urllib
from glob import glob from glob import glob
from cStringIO import StringIO from cStringIO import StringIO
from subprocess import check_call from subprocess import check_call
...@@ -48,7 +48,7 @@ from make import * ...@@ -48,7 +48,7 @@ from make import *
from debian.changelog import Changelog from debian.changelog import Changelog
from debian.deb822 import Deb822 from debian.deb822 import Deb822
BOOTSTRAP_URL = "http://downloads.buildout.org/1/bootstrap.py" BOOTSTRAP_URL = "https://bootstrap.pypa.io/bootstrap-buildout.py"
PACKAGE = "re6st-node" PACKAGE = "re6st-node"
BIN = "re6st-conf re6st-registry re6stnet".split() BIN = "re6st-conf re6st-registry re6stnet".split()
...@@ -66,6 +66,10 @@ re6stnet = git("re6stnet", "https://lab.nexedi.com/nexedi/re6stnet.git", ...@@ -66,6 +66,10 @@ re6stnet = git("re6stnet", "https://lab.nexedi.com/nexedi/re6stnet.git",
slapos = git("slapos", "https://lab.nexedi.com/nexedi/slapos.git", slapos = git("slapos", "https://lab.nexedi.com/nexedi/slapos.git",
ctime=False) # ignore ctime due to hardlinks to *-cache ctime=False) # ignore ctime due to hardlinks to *-cache
# The built Python can't use its certificates because its capath
# is already transformed to its installation value.
os.environ["SSL_CERT_DIR"] = ssl.get_default_verify_paths().capath
os.environ["TZ"] = "UTC"; time.tzset() os.environ["TZ"] = "UTC"; time.tzset()
@task("buildout.cfg.in", BUILD + "/buildout.cfg") @task("buildout.cfg.in", BUILD + "/buildout.cfg")
...@@ -87,8 +91,12 @@ def bootstrap(task): ...@@ -87,8 +91,12 @@ def bootstrap(task):
with cwd(BUILD): with cwd(BUILD):
rmtree("extends-cache") rmtree("extends-cache")
os.mkdir("extends-cache") os.mkdir("extends-cache")
check_output((sys.executable, "-S"), input=bootstrap) check_output((sys.executable, "-S", "-",
check_call(("bin/buildout", "buildout:parts=python")) # XXX: By starting with an older version,
# we'll have the wanted version in cache.
"--setuptools-version", "33.1.0"), input=bootstrap)
check_call(("bin/buildout", "buildout:extensions=",
"buildout:newest=true", "buildout:parts=python"))
def sdist_version(egg): def sdist_version(egg):
global MTIME, VERSION global MTIME, VERSION
......
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