Commit 808fd17c authored by Jérome Perrin's avatar Jérome Perrin

software/slapos-sr-testing: prevent softwares from using system python

Put broken python interpreters in path so that fail if they try to use
system python
parent 7414bb5a
...@@ -22,6 +22,7 @@ extends = ...@@ -22,6 +22,7 @@ extends =
parts = parts =
eggs/scripts eggs/scripts
python2.7-disabled
slapos-cookbook slapos-cookbook
template template
...@@ -251,6 +252,26 @@ branch = master ...@@ -251,6 +252,26 @@ branch = master
egg = slapos.core egg = slapos.core
setup = ${slapos.core-repository:location} setup = ${slapos.core-repository:location}
[python2.7-disabled]
# An "intentionally broken" python2 command that should catch
# accidental usage of things like #!/usr/bin/env python2
recipe = zc.recipe.egg
# we need an egg to generate a script, use the one from this part's recipe
eggs = ${:recipe}
interpreter = python2.7
entry-points =
python=${:eggs}:ignored
python2=${:eggs}:ignored
python2.7=${:eggs}:ignored
scripts =
python
python2
python2.7
initialization =
import sys
print("Error: attempt to use system python2", file=sys.stderr)
sys.exit(2)
[python-interpreter] [python-interpreter]
eggs += eggs +=
${lxml-python:egg} ${lxml-python:egg}
......
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