summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Dennis <jdennis@redhat.com>2018-06-21 14:49:30 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2018-07-24 09:03:09 (GMT)
commit87040110ed85ca2f9eb09f34d430e9ae83ad98b1 (patch)
treef1b0f39e4aef12137284f3146b7eb9d4b1bf72ec
parentf33d51db53373eb1f0a6429320e9de60210d5270 (diff)
downloadlasso-87040110ed85ca2f9eb09f34d430e9ae83ad98b1.zip
lasso-87040110ed85ca2f9eb09f34d430e9ae83ad98b1.tar.gz
lasso-87040110ed85ca2f9eb09f34d430e9ae83ad98b1.tar.bz2
Use python interpreter specified configure script
The configure script allows you to specify the python interpreter to use via the --with-python option. There were several places where the python interpreter was implicity invoked without using the specified version. This can create a number of problems in an environment with multiple python versions as is the case during the transition from Python 2 to Python 3. Python 2 is not compatible with Python 3. Lasso's Python code is supposed to be compatible with both versions. But during the build and when running the unit tests it is essential the same interpreter be used consistently otherwise you can have problems. This patch assures whenever python is invoked it does so via the $(PYTHON) configuration variable. What about shebang lines (e.g #/usr/bin/python) at the top of scripts? Python PEP 394 (https://www.python.org/dev/peps/pep-0394/) covers this. Basically it says if a script is compatible only with Py2 the shebang should be #/usr/bin/python2, if only compatible with Py3 the shebang should be #/usr/bin/python3. However, if the script is compatible with both versions it can continue to use the compatible with both Py2 and Py3. License: MIT Signed-off-by: John Dennis <jdennis@redhat.com>
-rw-r--r--bindings/java/Makefile.am2
-rw-r--r--bindings/python/tests/Makefile.am3
-rw-r--r--lasso/Makefile.am2
-rwxr-xr-xtools/check-lasso-sections.py2
4 files changed, 6 insertions, 3 deletions
diff --git a/bindings/java/Makefile.am b/bindings/java/Makefile.am
index 05e5f9e..8de0178 100644
--- a/bindings/java/Makefile.am
+++ b/bindings/java/Makefile.am
@@ -26,7 +26,7 @@ if WSF_ENABLED
EXTRA_ARGS = --enable-id-wsf
endif
-java_lasso_source_files := $(shell python $(top_srcdir)/bindings/bindings.py -l java-list --src-dir=$(top_srcdir)/lasso/ $(EXTRA_ARGS) )
+java_lasso_source_files := $(shell $(PYTHON) $(top_srcdir)/bindings/bindings.py -l java-list --src-dir=$(top_srcdir)/lasso/ $(EXTRA_ARGS) )
lasso_jardir=$(prefix)/share/java
lasso_jar_DATA=lasso.jar
diff --git a/bindings/python/tests/Makefile.am b/bindings/python/tests/Makefile.am
index 205e761..1305f26 100644
--- a/bindings/python/tests/Makefile.am
+++ b/bindings/python/tests/Makefile.am
@@ -11,5 +11,8 @@ if WSF_ENABLED
TESTS += idwsf1_tests.py idwsf2_tests.py
endif
+TEST_EXTENSIONS = .py
+PY_LOG_COMPILER = $(PYTHON)
+
EXTRA_DIST = profiles_tests.py binding_tests.py idwsf1_tests.py idwsf2_tests.py \
tests.py XmlTestRunner.py
diff --git a/lasso/Makefile.am b/lasso/Makefile.am
index 751f941..49ae88a 100644
--- a/lasso/Makefile.am
+++ b/lasso/Makefile.am
@@ -91,7 +91,7 @@ liblasso_la_LDFLAGS = -no-undefined -version-info @LASSO_VERSION_INFO@ \
endif
$(srcdir)/errors.c: $(srcdir)/errors.h $(srcdir)/build_strerror.py
- python $(srcdir)/build_strerror.py $(srcdir) >.errors.c.new
+ $(PYTHON) $(srcdir)/build_strerror.py $(srcdir) >.errors.c.new
if ! cmp -s $(srcdir)/errors.c .errors.c.new; then \
mv -f .errors.c.new $@; else \
rm .errors.c.new; fi
diff --git a/tools/check-lasso-sections.py b/tools/check-lasso-sections.py
index cb4c39c..3a6c988 100755
--- a/tools/check-lasso-sections.py
+++ b/tools/check-lasso-sections.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
import sys
import os.path