[Rpm-maint] [rpm-software-management/rpm] brp-python-bytecompile: Run a pre-flight find before invoking $default_python (#383)

Miro Hrončok notifications at github.com
Tue Jan 23 14:13:11 UTC 2018

This added check figures out whether invoking `$default_python` is necessary and exits early if no files would be bytecompiled by the two blocks below.

This prevent's invoking `$default_python` (i.e. `%{__python}` (i.e. most likely `/usr/bin/python`)) when not needed. Currently (before this change) it has been invoked twice for each build (iff the executable was present in the buildroot), even tough in most cases it did nothing. While this might have been harmless, it prevents us to deprecate or even forbid `/usr/bin/python` invocation during RPM build as proposed in Fedora in [1].

While this change is driven by Fedora's needs, I believe it can be useful for others as well. It doesn't render the script utterly more complex, while it prevents it from doing 2 superfluous (possibly slow) operations.

[1]: https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * brp-python-bytecompile: Run a pre-flight find before invoking $default_python

-- File Changes --

    M scripts/brp-python-bytecompile (4)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20180123/ee2fcbc4/attachment.html>

More information about the Rpm-maint mailing list