From e38c40157441819517392e6f1fab20299dd1e9d7 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Feb 14 2017 13:25:11 +0000 Subject: - Fix Python byte compilation for Python3 only packages - Fixes #1411588 --- diff --git a/rpm-4.13.x-brp-python-bytecompile-Python3-only.patch b/rpm-4.13.x-brp-python-bytecompile-Python3-only.patch new file mode 100644 index 0000000..56bc857 --- /dev/null +++ b/rpm-4.13.x-brp-python-bytecompile-Python3-only.patch @@ -0,0 +1,49 @@ +From a8e51b3bb05c6acb1d9b2e3d34f859ddda1677be Mon Sep 17 00:00:00 2001 +From: Florian Festi +Date: Tue, 14 Feb 2017 14:04:35 +0100 +Subject: [PATCH] brp-python-bytecompile: Process python lib dirs even without + standard Python + +There is no need for /usr/bin/python when byte compiling files in +/usr/lib/pythonX.Y (only /usr/bin/pythonX.Y). Moved check so we do not exit +prematurely. + +Fixes: rhbz#1411588 +--- + scripts/brp-python-bytecompile | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +diff --git a/scripts/brp-python-bytecompile b/scripts/brp-python-bytecompile +index 838f23d..894fa34 100644 +--- a/scripts/brp-python-bytecompile ++++ b/scripts/brp-python-bytecompile +@@ -6,12 +6,6 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then + exit 0 + fi + +-# If we don't have a python interpreter, avoid changing anything. +-default_python=${1:-/usr/bin/python} +-if [ ! -x "$default_python" ]; then +- exit 0 +-fi +- + # Figure out how deep we need to descend. We could pick an insanely high + # number and hope it's enough, but somewhere, somebody's sure to run into it. + depth=`(find "$RPM_BUILD_ROOT" -type f -name "*.py" -print0 ; echo /) | \ +@@ -86,7 +80,12 @@ done + + + # Handle other locations in the filesystem using the default python +-# implementation: ++# implementation - if we have a default python interpreter ++ ++default_python=${1:-/usr/bin/python} ++if [ ! -x "$default_python" ]; then ++ exit 0 ++fi + + # Generate normal (.pyc) byte-compiled files. + python_bytecompile "" $default_python "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]|/usr/share/doc" "$RPM_BUILD_ROOT" "$depth" "/" +-- +2.5.5 + diff --git a/rpm.spec b/rpm.spec index d9c8f4f..6970a55 100644 --- a/rpm.spec +++ b/rpm.spec @@ -29,7 +29,7 @@ Summary: The RPM package management system Name: rpm Version: %{rpmver} -Release: %{?snapver:0.%{snapver}.}11%{?dist}.1 +Release: %{?snapver:0.%{snapver}.}12%{?dist} Group: System Environment/Base Url: http://www.rpm.org/ Source0: http://rpm.org/releases/%{srcdir}/%{name}-%{srcver}.tar.bz2 @@ -63,9 +63,11 @@ Patch136: rpm-4.13.x-pythondistdeps.py-skip-distribution-metadata-if-ther.patch Patch137: rpm-4.13.x-pythondistdeps.py-show-warning-if-version-is-not-fou.patch Patch138: rpm-4.13.x-pythondistdeps.py-skip-.egg-link-files.patch Patch139: rpm-4.13.x-pythondistdeps.py-add-forgotten-import.patch +Patch140: rpm-4.13.x-brp-python-bytecompile-Python3-only.patch # Fedora-specific (python3) patch (RHBZ #1405483) -Patch140: rpm-4.13.x-pythondistdeps-python3.patch +Patch200: rpm-4.13.x-pythondistdeps-python3.patch + # These are not yet upstream Patch302: rpm-4.7.1-geode-i686.patch @@ -567,6 +569,9 @@ exit 0 %doc doc/librpm/html/* %changelog +* Tue Feb 14 2017 Florian Festi - 4.13.0-12 +- Fix Python byte compilation for Python3 only packages (#1411588) + * Sat Feb 11 2017 Fedora Release Engineering - 4.13.0-11.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild