Workaround leaking buildroot PATH in %py_byte_compile (#1647212)

This commit is contained in:
Miro Hrončok 2018-12-05 15:35:41 +01:00
parent c8932dcbef
commit 4b3c23b233
2 changed files with 12 additions and 4 deletions

View File

@ -14,6 +14,11 @@
%py_byte_compile()\ %py_byte_compile()\
python_binary="%1"\ python_binary="%1"\
bytecode_compilation_path="%2"\ buildroot_path="%2"\
find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -m py_compile\ bytecode_compilation_path=".${buildroot_path/#$RPM_BUILD_ROOT}"\
find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -m py_compile 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

View File

@ -1,6 +1,6 @@
Name: python-rpm-macros Name: python-rpm-macros
Version: 3 Version: 3
Release: 39%{?dist} Release: 40%{?dist}
Summary: The unversioned Python RPM macros Summary: The unversioned Python RPM macros
License: MIT License: MIT
@ -73,6 +73,9 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} \
%changelog %changelog
* Wed Dec 05 2018 Miro Hrončok <mhroncok@redhat.com> - 3-40
- Workaround leaking buildroot PATH in %py_byte_compile (#1647212)
* Thu Nov 01 2018 Petr Viktorin <pviktori@redhat.com> - 3-39 * Thu Nov 01 2018 Petr Viktorin <pviktori@redhat.com> - 3-39
- Move "sleep 1" workaround from py3_build to py2_build (#1644923) - Move "sleep 1" workaround from py3_build to py2_build (#1644923)