michal-grzedzicki / rpms / rpm

Forked from rpms/rpm 4 months ago
Clone

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

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