Blame SOURCES/use-specified-python-interpreter.patch

0f20f5
commit e3e904af7dd308fe7530773bd9ea136afc90049b
0f20f5
Author: John Dennis <jdennis@redhat.com>
0f20f5
Date:   Thu Jun 21 10:49:30 2018 -0400
0f20f5
0f20f5
    Use python interpreter specified configure script
0f20f5
    
0f20f5
    The configure script allows you to specify the python interpreter to
0f20f5
    use via the --with-python option. There were several places where the
0f20f5
    python interpreter was implicity invoked without using the specified
0f20f5
    version. This can create a number of problems in an environment with
0f20f5
    multiple python versions as is the case during the transition from
0f20f5
    Python 2 to Python 3. Python 2 is not compatible with Python
0f20f5
    3. Lasso's Python code is supposed to be compatible with both
0f20f5
    versions. But during the build and when running the unit tests it is
0f20f5
    essential the same interpreter be used consistently otherwise you can
0f20f5
    have problems.
0f20f5
    
0f20f5
    This patch assures whenever python is invoked it does so via the
0f20f5
    $(PYTHON) configuration variable.
0f20f5
    
0f20f5
    What about shebang lines (e.g #/usr/bin/python) at the top of scripts?
0f20f5
    Python PEP 394 (https://www.python.org/dev/peps/pep-0394/) covers
0f20f5
    this. Basically it says if a script is compatible only with Py2 the
0f20f5
    shebang should be #/usr/bin/python2, if only compatible with Py3 the
0f20f5
    shebang should be #/usr/bin/python3. However, if the script is
0f20f5
    compatible with both versions it can continue to use the
0f20f5
    compatible with both Py2 and Py3.
0f20f5
    
0f20f5
    License: MIT
0f20f5
    Signed-off-by: John Dennis <jdennis@redhat.com>
0f20f5
0f20f5
diff --git a/bindings/java/Makefile.am b/bindings/java/Makefile.am
0f20f5
index 05e5f9ee..8de0178d 100644
0f20f5
--- a/bindings/java/Makefile.am
0f20f5
+++ b/bindings/java/Makefile.am
0f20f5
@@ -26,7 +26,7 @@ if WSF_ENABLED
0f20f5
 EXTRA_ARGS = --enable-id-wsf
0f20f5
 endif
0f20f5
 
0f20f5
-java_lasso_source_files := $(shell python $(top_srcdir)/bindings/bindings.py -l java-list --src-dir=$(top_srcdir)/lasso/ $(EXTRA_ARGS) )
0f20f5
+java_lasso_source_files := $(shell $(PYTHON) $(top_srcdir)/bindings/bindings.py -l java-list --src-dir=$(top_srcdir)/lasso/ $(EXTRA_ARGS) )
0f20f5
 
0f20f5
 lasso_jardir=$(prefix)/share/java
0f20f5
 lasso_jar_DATA=lasso.jar
0f20f5
diff --git a/bindings/python/tests/Makefile.am b/bindings/python/tests/Makefile.am
0f20f5
index 205e7613..1305f26f 100644
0f20f5
--- a/bindings/python/tests/Makefile.am
0f20f5
+++ b/bindings/python/tests/Makefile.am
0f20f5
@@ -11,5 +11,8 @@ if WSF_ENABLED
0f20f5
 TESTS += idwsf1_tests.py idwsf2_tests.py
0f20f5
 endif
0f20f5
 
0f20f5
+TEST_EXTENSIONS = .py
0f20f5
+PY_LOG_COMPILER = $(PYTHON)
0f20f5
+
0f20f5
 EXTRA_DIST = profiles_tests.py binding_tests.py idwsf1_tests.py idwsf2_tests.py \
0f20f5
 	tests.py XmlTestRunner.py
0f20f5
diff --git a/lasso/Makefile.am b/lasso/Makefile.am
0f20f5
index 751f9419..49ae88a7 100644
0f20f5
--- a/lasso/Makefile.am
0f20f5
+++ b/lasso/Makefile.am
0f20f5
@@ -91,7 +91,7 @@ liblasso_la_LDFLAGS = -no-undefined -version-info @LASSO_VERSION_INFO@  \
0f20f5
 endif
0f20f5
 
0f20f5
 $(srcdir)/errors.c: $(srcdir)/errors.h $(srcdir)/build_strerror.py
0f20f5
-	python $(srcdir)/build_strerror.py $(srcdir) >.errors.c.new
0f20f5
+	$(PYTHON) $(srcdir)/build_strerror.py $(srcdir) >.errors.c.new
0f20f5
 	if ! cmp -s $(srcdir)/errors.c .errors.c.new; then \
0f20f5
 	mv -f .errors.c.new $@; else \
0f20f5
 	rm .errors.c.new; fi
0f20f5
diff --git a/tools/check-lasso-sections.py b/tools/check-lasso-sections.py
0f20f5
index cb4c39c4..3a6c9880 100755
0f20f5
--- a/tools/check-lasso-sections.py
0f20f5
+++ b/tools/check-lasso-sections.py
0f20f5
@@ -1,4 +1,4 @@
0f20f5
-#!/usr/bin/python
0f20f5
+#!/usr/bin/env python
0f20f5
 
0f20f5
 import sys
0f20f5
 import os.path