dcavalca / rpms / rpm

Forked from rpms/rpm a year ago
Clone

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

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