From 4b3c23b2337df1512b0eff3fe10fb96a8dc9454f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 5 Dec 2018 15:35:41 +0100 Subject: [PATCH] Workaround leaking buildroot PATH in %py_byte_compile (#1647212) --- macros.pybytecompile | 11 ++++++++--- python-rpm-macros.spec | 5 ++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/macros.pybytecompile b/macros.pybytecompile index a41b3a2..d06071e 100644 --- a/macros.pybytecompile +++ b/macros.pybytecompile @@ -14,6 +14,11 @@ %py_byte_compile()\ python_binary="%1"\ -bytecode_compilation_path="%2"\ -find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -m py_compile\ -find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -m py_compile +buildroot_path="%2"\ +bytecode_compilation_path=".${buildroot_path/#$RPM_BUILD_ROOT}"\ +failure=0\ +pushd $RPM_BUILD_ROOT\ +find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -m py_compile || failure=1\ +find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -m py_compile || failure=1\ +popd\ +test $failure -eq 0 diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index 1d26b45..44639b8 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,6 +1,6 @@ Name: python-rpm-macros Version: 3 -Release: 39%{?dist} +Release: 40%{?dist} Summary: The unversioned Python RPM macros License: MIT @@ -73,6 +73,9 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} \ %changelog +* Wed Dec 05 2018 Miro HronĨok - 3-40 +- Workaround leaking buildroot PATH in %py_byte_compile (#1647212) + * Thu Nov 01 2018 Petr Viktorin - 3-39 - Move "sleep 1" workaround from py3_build to py2_build (#1644923)