Fixed .pyc bytecompilation

- Updated .pyc 'bytecompilation with the newly installed interpreter' to also
  recompile optimized .pyc files
- Removed .pyo 'bytecompilation with the newly installed interpreter', as .pyo
  files are no more
- Resolves rhbz#1373635
This commit is contained in:
Tomas Orsava 2016-09-09 13:27:29 +02:00
parent ea6fb09bb5
commit b2fa0070fc

View File

@ -112,7 +112,7 @@
Summary: Version 3 of the Python programming language aka Python 3000 Summary: Version 3 of the Python programming language aka Python 3000
Name: python3 Name: python3
Version: %{pybasever}.2 Version: %{pybasever}.2
Release: 1%{?dist} Release: 2%{?dist}
License: Python License: Python
Group: Development/Languages Group: Development/Languages
@ -953,16 +953,11 @@ iconv -f iso8859-1 -t utf-8 %{buildroot}/%{pylibdir}/Demo/rpc/README > README.co
# Do bytecompilation with the newly installed interpreter. # Do bytecompilation with the newly installed interpreter.
# This is similar to the script in macros.pybytecompile # This is similar to the script in macros.pybytecompile
# compile *.pyo
find %{buildroot} -type f -a -name "*.py" -print0 | \
LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2]) for f in sys.argv[1:]]' || :
# compile *.pyc # compile *.pyc
find %{buildroot} -type f -a -name "*.py" -print0 | \ find %{buildroot} -type f -a -name "*.py" -print0 | \
LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \ LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \ PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2], optimize=0) for f in sys.argv[1:]]' || : xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2], optimize=opt) for opt in range(3) for f in sys.argv[1:]]' || :
# Fixup permissions for shared libraries from non-standard 555 to standard 755: # Fixup permissions for shared libraries from non-standard 555 to standard 755:
find %{buildroot} \ find %{buildroot} \
@ -1552,6 +1547,13 @@ rm -fr %{buildroot}
# ====================================================== # ======================================================
%changelog %changelog
* Fri Sep 09 2016 Tomas Orsava <torsava@redhat.com> - 3.5.2-2
- Updated .pyc 'bytecompilation with the newly installed interpreter' to also
recompile optimized .pyc files
- Removed .pyo 'bytecompilation with the newly installed interpreter', as .pyo
files are no more
- Resolves rhbz#1373635
* Mon Aug 15 2016 Tomas Orsava <torsava@redhat.com> - 3.5.2-1 * Mon Aug 15 2016 Tomas Orsava <torsava@redhat.com> - 3.5.2-1
- Rebased to version 3.5.2 - Rebased to version 3.5.2
- Set to work with pip version 8.1.2 - Set to work with pip version 8.1.2