Commit ad4b2e8b authored by Jérome Perrin's avatar Jérome Perrin

component/ca-certificates: don't use implicit `python`

We can not rely on system python here, it's a bit better to rely on
buildout's python ( the main reason is that it complies with
slapos-sr-testing not having system python ).

The implementation is a bit complicated, we can not just reference
${buildout:executable} in the profile, because doing so will cause an
infinite loop with rebootstrap and software installation never finish
because options of ca-certificates change at every run if they include
the python path. Instead, we use a pre-make-hook to rewrite the Makefile
without saving the interpreter in option. This python is only used
during the build process (to generate the certificate files) and not
used at run time, so it does not really depend on python strictly
speaking. Anyway, because it's a component used very early in the
bootstrap, we can not reference python here.
parent 62c342c2
...@@ -16,10 +16,12 @@ url = http://deb.debian.org/debian/pool/main/c/ca-certificates/ca-certificates_2 ...@@ -16,10 +16,12 @@ url = http://deb.debian.org/debian/pool/main/c/ca-certificates/ca-certificates_2
md5sum = e91d3d9259127ba2dbb65fda58d73f31 md5sum = e91d3d9259127ba2dbb65fda58d73f31
patch-binary = ${patch:location}/bin/patch patch-binary = ${patch:location}/bin/patch
patches = patches =
${:_profile_base_location_}/ca-certificates-any-python.patch#b7e234b1b2a40750c054c06603fb3749 ${:_profile_base_location_}/ca-certificates-any-python.patch#0f9dfaed4672e53d66f4aebee030d0fd
${:_profile_base_location_}/ca-certificates-sbin-dir.patch#0b4e7d82ce768823c01954ee41ef177b ${:_profile_base_location_}/ca-certificates-sbin-dir.patch#0b4e7d82ce768823c01954ee41ef177b
patch-options = -p0 patch-options = -p0
configure-command = true configure-command = true
make-targets = install DESTDIR=@@LOCATION@@ CERTSDIR=certs SBINDIR=sbin make-targets = install DESTDIR=@@LOCATION@@ CERTSDIR=certs SBINDIR=sbin
environment = environment =
PATH=${xz-utils:location}/bin:%(PATH)s PATH=${xz-utils:location}/bin:%(PATH)s
pre-make-hook =
${:_profile_base_location_}/ca-certificates-pre-make-hook.py#9e2f6f22d91ea7a089f0ea2c523b0c1e:pre_make_hook
...@@ -11,13 +11,12 @@ ...@@ -11,13 +11,12 @@
if line.startswith('CKA_CLASS'): if line.startswith('CKA_CLASS'):
--- mozilla/Makefile 2015-12-20 10:49:23.000000000 +0100 --- mozilla/Makefile 2015-12-20 10:49:23.000000000 +0100
+++ mozilla/Makefile 2016-01-05 20:19:11.006874271 +0100 +++ mozilla/Makefile 2016-01-05 20:19:11.006874271 +0100
@@ -3,7 +3,8 @@ @@ -3,7 +3,7 @@
# #
all: all:
- python certdata2pem.py - python certdata2pem.py
+ for x in 3 '' 2; do type python$$x && break; done >/dev/null \ + SLAPOS_BUILDOUT_PYTHON certdata2pem.py
+ && python$$x certdata2pem.py
clean: clean:
-rm -f *.crt -rm -f *.crt
import pathlib
import sys
def pre_make_hook(options, buildout, environ):
makefile = pathlib.Path('mozilla/Makefile')
txt = makefile.read_text().replace('SLAPOS_BUILDOUT_PYTHON', sys.executable)
makefile.write_text(txt)
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