teknoraver / rpms / rpm

Forked from rpms/rpm 3 months ago
Clone

Blame SOURCES/0001-Honor-PYTHON-from-configure-when-running-tests.patch

ed184b
From 6b6c4d881dc6fc99f949dac4aaf9a513542f9956 Mon Sep 17 00:00:00 2001
ed184b
Message-Id: <6b6c4d881dc6fc99f949dac4aaf9a513542f9956.1571920849.git.pmatilai@redhat.com>
ed184b
From: Panu Matilainen <pmatilai@redhat.com>
ed184b
Date: Wed, 3 Oct 2018 15:22:55 +0300
ed184b
Subject: [PATCH 1/5] Honor PYTHON from configure when running tests
ed184b
ed184b
Pass PYTHON from configure down through all the nutty layers of make
ed184b
to allow running test-suite with Python 3. In theory that is.
ed184b
ed184b
(cherry picked from commit dcd5ab67c40b543f22b07df8c1028c34b94a7929)
ed184b
---
ed184b
 tests/Makefile.am | 1 +
ed184b
 tests/atlocal.in  | 3 ++-
ed184b
 tests/local.at    | 2 +-
ed184b
 3 files changed, 4 insertions(+), 2 deletions(-)
ed184b
ed184b
diff --git a/tests/Makefile.am b/tests/Makefile.am
ed184b
index eaf817cc2..21ca216a8 100644
ed184b
--- a/tests/Makefile.am
ed184b
+++ b/tests/Makefile.am
ed184b
@@ -117,6 +117,7 @@ atlocal:	atlocal.in Makefile
ed184b
 	  -e "s,[@]usrlibdir[@],$(libdir)," \
ed184b
 	  -e "s,[@]execprefix[@],$(exec_prefix)," \
ed184b
 	  -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir)," \
ed184b
+	  -e "s,[@]PYTHON[@],$(PYTHON)," \
ed184b
 	< $(srcdir)/atlocal.in > atlocal
ed184b
 DISTCLEANFILES = atlocal
ed184b
 EXTRA_DIST += atlocal.in
ed184b
diff --git a/tests/atlocal.in b/tests/atlocal.in
ed184b
index d7d837f45..3b1474b56 100644
ed184b
--- a/tests/atlocal.in
ed184b
+++ b/tests/atlocal.in
ed184b
@@ -3,7 +3,8 @@ export LD_LIBRARY_PATH
ed184b
 PATH="${abs_builddir}/testing@rpmbindir@:${abs_builddir}/testing@usrbindir@:$PATH"
ed184b
 export PATH
ed184b
 
ed184b
-PYLIBDIR=`python -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1,0,'@execprefix@'))"`
ed184b
+PYTHON=@PYTHON@
ed184b
+PYLIBDIR=$(${PYTHON} -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1,0,'@execprefix@'))")
ed184b
 PYTHONPATH="${abs_builddir}/testing${PYLIBDIR}"
ed184b
 export PYTHONPATH
ed184b
 
ed184b
diff --git a/tests/local.at b/tests/local.at
ed184b
index 48c5d3f96..4952b9d61 100644
ed184b
--- a/tests/local.at
ed184b
+++ b/tests/local.at
ed184b
@@ -17,7 +17,7 @@ def myprint(msg = ''):
ed184b
     sys.stdout.write('%s\n' % msg)
ed184b
 $1
ed184b
 EOF
ed184b
-python test.py
ed184b
+${PYTHON} test.py
ed184b
 ]])
ed184b
 
ed184b
 m4_define([RPMPY_CHECK],[
ed184b
-- 
ed184b
2.21.0
ed184b