diff --git a/macros.pybytecompile b/macros.pybytecompile index f319979..390d4f7 100644 --- a/macros.pybytecompile +++ b/macros.pybytecompile @@ -21,5 +21,5 @@ py3_byte_compile () {\ find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2], optimize=opt) for opt in range(2) for f in sys.argv[1:]]' || :\ }\ \ -[[ "%1" == *python3* ]] || py2_byte_compile "%1" "%2" && py3_byte_compile "%1" "%2" \ +[[ "%1" != *python3* ]] && py2_byte_compile "%1" "%2" || py3_byte_compile "%1" "%2" \ %{nil} diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index 413bbc1..8a239af 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,6 +1,6 @@ Name: python-rpm-macros Version: 3 -Release: 31%{?dist} +Release: 32%{?dist} Summary: The unversioned Python RPM macros License: MIT @@ -71,6 +71,10 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} \ %changelog +* Tue Jul 10 2018 Tomas Orsava - 3-32 +- Fix %%py_byte_compile macro: when invoked with a Python 2 binary it also + mistakenly ran py3_byte_compile + * Tue Jul 03 2018 Miro HronĨok - 3-31 - Add %%python3_platform useful for PYTHONPATH on arched builds