From e79d625c87aa97deb12d8860e68e2bfd81cf1873 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 29 Jun 2018 11:41:26 +0300 Subject: [PATCH] Make it actually build, sigh - Ehm, need to patch the autogenerated rpmtests script too for python2 - Ehm, it's ldconfig_scriptlets not scripts - Drop the non-working python envvar magic from obsoleted change --- ...hat-will-be-present-during-RPM-build.patch | 28 - rpm-4.14.1-explicit-python2.patch | 515 +++++++++++++++++- rpm.spec | 20 +- 3 files changed, 519 insertions(+), 44 deletions(-) delete mode 100644 rpm-4.14.1-Add-envvar-that-will-be-present-during-RPM-build.patch diff --git a/rpm-4.14.1-Add-envvar-that-will-be-present-during-RPM-build.patch b/rpm-4.14.1-Add-envvar-that-will-be-present-during-RPM-build.patch deleted file mode 100644 index 361e1a4..0000000 --- a/rpm-4.14.1-Add-envvar-that-will-be-present-during-RPM-build.patch +++ /dev/null @@ -1,28 +0,0 @@ -From bf636421120aa2c97f9e0fdcee3c211b4241bd86 Mon Sep 17 00:00:00 2001 -From: Tomas Orsava -Date: Mon, 29 Jan 2018 16:13:18 +0100 -Subject: [PATCH] Add envvar that will be present during RPM build - -Part of a Fedora Change for F28: -"Avoid /usr/bin/python in RPM build" -https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build ---- - macros.in | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/macros.in b/macros.in -index dd6ef67..68449e3 100644 ---- a/macros.in -+++ b/macros.in -@@ -804,6 +804,8 @@ package or when debugging this package.\ - export PKG_CONFIG_PATH\ - CONFIG_SITE=${CONFIG_SITE:-NONE}\ - export CONFIG_SITE\ -+ PYTHON_DISALLOW_AMBIGUOUS_VERSION=warn\ -+ export PYTHON_DISALLOW_AMBIGUOUS_VERSION\ - \ - %{verbose:set -x}%{!verbose:exec > /dev/null}\ - umask 022\ --- -2.13.6 - diff --git a/rpm-4.14.1-explicit-python2.patch b/rpm-4.14.1-explicit-python2.patch index 8eec835..7c946ae 100644 --- a/rpm-4.14.1-explicit-python2.patch +++ b/rpm-4.14.1-explicit-python2.patch @@ -1,12 +1,519 @@ +diff -up rpm-4.14.1/tests/rpmtests.python2 rpm-4.14.1/tests/rpmtests +--- rpm-4.14.1/tests/rpmtests.python2 2018-06-29 11:48:40.973388135 +0300 ++++ rpm-4.14.1/tests/rpmtests 2018-06-29 11:49:04.357354872 +0300 +@@ -27979,7 +27979,7 @@ def myprint(msg = ''): + myprint(rpm.__version__) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:6" + ( $at_check_trace; +@@ -27993,7 +27993,7 @@ def myprint(msg = ''): + myprint(rpm.__version__) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -28052,7 +28052,7 @@ rpm.delMacro(mname) + prexp(mname) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:12" + ( $at_check_trace; +@@ -28078,7 +28078,7 @@ rpm.delMacro(mname) + prexp(mname) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -28159,7 +28159,7 @@ for iot in [ 'fpio', 'fdio', 'ufdio', 'g + myprint('%s sized read fail (got %d bytes)\\n%s' % (iot, len(rdata), rdata)) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:35" + ( $at_check_trace; +@@ -28203,7 +28203,7 @@ for iot in [ 'fpio', 'fdio', 'ufdio', 'g + myprint('%s sized read fail (got %d bytes)\n%s' % (iot, len(rdata), rdata)) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -28254,7 +28254,7 @@ for pkg in spec.packages: + myprint(spec.sourceHeader.format('%{nvr}')) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:70" + ( $at_check_trace; +@@ -28274,7 +28274,7 @@ for pkg in spec.packages: + myprint(spec.sourceHeader.format('%{nvr}')) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -28338,7 +28338,7 @@ for a in ['name', 'bugurl', '__class__', + myprint(exc) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:85" + ( $at_check_trace; +@@ -28366,7 +28366,7 @@ for a in ['name', 'bugurl', '__class__', + myprint(exc) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -28430,7 +28430,7 @@ for h in [h1, h2]: + myprint(exc) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:110" + ( $at_check_trace; +@@ -28456,7 +28456,7 @@ for h in [h1, h2]: + myprint(exc) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -28506,7 +28506,7 @@ h = ts.hdrFromFdno('\${RPMDATA}/RPMS/hel + myprint(h['arch']) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:129" + ( $at_check_trace; +@@ -28522,7 +28522,7 @@ h = ts.hdrFromFdno('${RPMDATA}/RPMS/hell + myprint(h['arch']) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -28577,7 +28577,7 @@ except rpm.error, e: + myprint(e) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:137" + ( $at_check_trace; +@@ -28599,7 +28599,7 @@ except rpm.error, e: + myprint(e) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -28658,7 +28658,7 @@ except rpm.error, e: + myprint(e) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:152" + ( $at_check_trace; +@@ -28684,7 +28684,7 @@ except rpm.error, e: + myprint(e) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -28737,7 +28737,7 @@ for e in ts: + myprint(e.NEVRA()) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:170" + ( $at_check_trace; +@@ -28757,7 +28757,7 @@ for e in ts: + myprint(e.NEVRA()) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -28812,7 +28812,7 @@ for e in ts: + myprint(e.NEVRA()) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:182" + ( $at_check_trace; +@@ -28834,7 +28834,7 @@ for e in ts: + myprint(e.NEVRA()) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -28896,7 +28896,7 @@ for e in ts: + myprint(e.NEVRA()) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:196" + ( $at_check_trace; +@@ -28925,7 +28925,7 @@ for e in ts: + myprint(e.NEVRA()) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -29011,7 +29011,7 @@ for h in ts.dbMatch('packages', ix): + myprint(h['nevra']) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:231" + ( $at_check_trace; +@@ -29034,7 +29034,7 @@ for h in ts.dbMatch('packages', ix): + myprint(h['nevra']) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -29066,7 +29066,7 @@ for h in mi: + myprint(h['nevra']) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:247" + ( $at_check_trace; +@@ -29084,7 +29084,7 @@ for h in mi: + myprint(h['nevra']) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -29114,7 +29114,7 @@ for h in ts.dbMatch('name'): + myprint(h['nevra']) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:258" + ( $at_check_trace; +@@ -29130,7 +29130,7 @@ for h in ts.dbMatch('name'): + myprint(h['nevra']) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -29161,7 +29161,7 @@ for h in ts.dbMatch('obsoletes'): + myprint(h['nevra']) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:268" + ( $at_check_trace; +@@ -29177,7 +29177,7 @@ for h in ts.dbMatch('obsoletes'): + myprint(h['nevra']) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -29207,7 +29207,7 @@ for h in ts.dbMatch('provides', 'hi'): + myprint(h['nevra']) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:277" + ( $at_check_trace; +@@ -29223,7 +29223,7 @@ for h in ts.dbMatch('provides', 'hi'): + myprint(h['nevra']) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -29253,7 +29253,7 @@ for h in ts.dbMatch('basenames', '/usr/s + myprint(h['nevra']) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:286" + ( $at_check_trace; +@@ -29269,7 +29269,7 @@ for h in ts.dbMatch('basenames', '/usr/s + myprint(h['nevra']) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -29298,7 +29298,7 @@ for di in sorted(ts.dbIndex('obsoletes') + myprint(di) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:294" + ( $at_check_trace; +@@ -29314,7 +29314,7 @@ for di in sorted(ts.dbIndex('obsoletes') + myprint(di) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -29344,7 +29344,7 @@ for di in sorted(ts.dbIndex('provides')) + myprint(di) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:303" + ( $at_check_trace; +@@ -29360,7 +29360,7 @@ for di in sorted(ts.dbIndex('provides')) + myprint(di) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -29413,7 +29413,7 @@ for dep in rpm.ds(h, 'requires'): + myprint(dep.DNEVR()) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:316" + ( $at_check_trace; +@@ -29430,7 +29430,7 @@ for dep in rpm.ds(h, 'requires'): + myprint(dep.DNEVR()) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -29488,7 +29488,7 @@ ds = rpm.ds(h, 'provides') + myprint('%d %d' % (ds.Instance(), ds.Count())) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:333" + ( $at_check_trace; +@@ -29505,7 +29505,7 @@ ds = rpm.ds(h, 'provides') + myprint('%d %d' % (ds.Instance(), ds.Count())) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -29557,7 +29557,7 @@ for f in fi: + myprint('%x: %s' % (fi.FFlags(), fi.FN())) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:343" + ( $at_check_trace; +@@ -29576,7 +29576,7 @@ for f in fi: + myprint('%x: %s' % (fi.FFlags(), fi.FN())) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -29633,7 +29633,7 @@ for i in range(1, len(p)+1): + myprint('%s: %s' % (i, p[i])) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:360" + ( $at_check_trace; +@@ -29652,7 +29652,7 @@ for i in range(1, len(p)+1): + myprint('%s: %s' % (i, p[i])) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -29710,7 +29710,7 @@ myprint(d2.DNEVR()) + myprint(d3.DNEVR()) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:375" + ( $at_check_trace; +@@ -29732,7 +29732,7 @@ myprint(d2.DNEVR()) + myprint(d3.DNEVR()) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -29796,7 +29796,7 @@ for f in archive: + break + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:393" + ( $at_check_trace; +@@ -29824,7 +29824,7 @@ for f in archive: + break + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -29879,7 +29879,7 @@ len2 = len(h.unload()) + myprint(len1 == len2) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmpython.at:413" + ( $at_check_trace; +@@ -29903,7 +29903,7 @@ len2 = len(h.unload()) + myprint(len1 == len2) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false +@@ -30183,7 +30183,7 @@ for p, r, res in tests: + myprint('FAILED: %s with %s: %s' % (d1.DNEVR(), d2.DNEVR(),ms[res])) + + EOF +-python test.py ++python2 test.py + " + at_fn_check_prepare_notrace 'a ${...} parameter expansion' "rpmdepmatch.at:4" + ( $at_check_trace; +@@ -30430,7 +30430,7 @@ for p, r, res in tests: + myprint('FAILED: %s with %s: %s' % (d1.DNEVR(), d2.DNEVR(),ms[res])) + + EOF +-python test.py ++python2 test.py + + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- + at_status=$? at_failed=false diff -up rpm-4.14.1/tests/local.at.python2 rpm-4.14.1/tests/local.at ---- rpm-4.14.1/tests/local.at.python2 2018-06-29 11:11:42.716541572 +0300 -+++ rpm-4.14.1/tests/local.at 2017-09-06 14:58:13.034317976 +0300 +--- rpm-4.14.1/tests/local.at.python2 2018-06-29 12:01:35.834278375 +0300 ++++ rpm-4.14.1/tests/local.at 2018-06-29 12:01:44.007266563 +0300 @@ -17,7 +17,7 @@ def myprint(msg = ''): sys.stdout.write('%s\n' % msg) $1 EOF --python2 test.py -+python test.py +-python test.py ++python2 test.py ]]) m4_define([RPMPY_CHECK],[ diff --git a/rpm.spec b/rpm.spec index 7863ade..4ec339a 100644 --- a/rpm.spec +++ b/rpm.spec @@ -23,7 +23,7 @@ %global rpmver 4.14.1 #global snapver rc2 -%global rel 12 +%global rel 13 %global srcver %{version}%{?snapver:-%{snapver}} %global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(echo %{version} | cut -d'.' -f1-2).x} @@ -62,20 +62,11 @@ Patch5: rpm-4.12.0-rpm2cpio-hack.patch # https://github.com/rpm-software-management/rpm/pull/434 Patch6: rpm-4.14.1-python-brp-bytecompile.patch -# Downstream-only patch: -# Add envvar that will be present during RPM build -# - Part of a Fedora Change for F28: -# - "Avoid /usr/bin/python in RPM build" -# - https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build -Patch7: rpm-4.14.1-Add-envvar-that-will-be-present-during-RPM-build.patch - # find-debuginfo.sh: Handle application/x-pie-executable (file 5.33 output). # http://lists.rpm.org/pipermail/rpm-maint/2018-May/007976.html # https://bugzilla.redhat.com/show_bug.cgi?id=1581224 Patch8: 4.14.1-find-debuginfo-pie.patch -# More Python 3 fallout, invoke python2 explicitly to avoid deprecation -# warnings breaking the test-suite Patch9: rpm-4.14.1-explicit-python2.patch # Patches already upstream: @@ -473,8 +464,8 @@ make check || cat tests/rpmtests.log %endif # Fedora < 28 and EPEL-7 builds need these -%ldconfig_scripts libs -%ldconfig_scripts build-libs +%ldconfig_scriptlets libs +%ldconfig_scriptlets build-libs %files -f %{name}.lang %license COPYING @@ -609,6 +600,11 @@ make check || cat tests/rpmtests.log %doc doc/librpm/html/* %changelog +* Fri Jun 29 2018 Panu Matilainen - 4.14.2-13 +- Ehm, need to patch the autogenerated rpmtests script too for python2 +- Ehm, it's ldconfig_scriptlets not scripts +- Drop the non-working python envvar magic from obsoleted change + * Fri Jun 29 2018 Panu Matilainen - 4.14.2-12 - Invoke python2 explicitly from test-suite to unbreak build