Backport upstream solution to make brp-python-bytecompile automagic part opt-outable

See https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation
This commit is contained in:
Miro Hrončok 2018-05-28 14:12:32 +02:00
parent 43ea916f2f
commit 364d038b55
2 changed files with 31 additions and 4 deletions

View File

@ -1,8 +1,29 @@
diff --git a/scripts/brp-python-bytecompile b/scripts/brp-python-bytecompile
index 894fa3459..47776215a 100644
index 894fa34..c06bdfa 100644
--- a/scripts/brp-python-bytecompile
+++ b/scripts/brp-python-bytecompile
@@ -87,6 +87,10 @@ if [ ! -x "$default_python" ]; then
@@ -1,5 +1,6 @@
#!/bin/bash
errors_terminate=$2
+extra=$3
# If using normal root, avoid changing anything.
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
@@ -79,14 +80,22 @@ do
done
-# Handle other locations in the filesystem using the default python
-# implementation - if we have a default python interpreter
+# Handle other locations in the filesystem using the default python implementation
+# if extra is set to 0, don't do this
+if [ 0$extra -eq 0 ]; then
+ exit 0
+fi
+# If we don't have a default python interpreter, we cannot proceed
default_python=${1:-/usr/bin/python}
if [ ! -x "$default_python" ]; then
exit 0
fi

View File

@ -23,7 +23,7 @@
%global rpmver 4.14.1
#global snapver rc2
%global rel 9
%global rel 10
%global srcver %{version}%{?snapver:-%{snapver}}
%global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(echo %{version} | cut -d'.' -f1-2).x}
@ -56,8 +56,10 @@ Patch3: rpm-4.9.90-no-man-dirs.patch
Patch4: rpm-4.8.1-use-gpg2.patch
# Temporary band-aid for rpm2cpio whining on payload size mismatch (#1142949)
Patch5: rpm-4.12.0-rpm2cpio-hack.patch
# Skip automatic Python byte-compilation if *.py files are not present
# Skip automatic Python byte-compilation (outside of Python directories) if
# *.py files are not present, and allow to disable it even if they are
# Upstream pull request: https://github.com/rpm-software-management/rpm/pull/383
# https://github.com/rpm-software-management/rpm/pull/434
Patch6: rpm-4.14.1-python-brp-bytecompile.patch
# Downstream-only patch:
@ -605,6 +607,10 @@ make check || cat tests/rpmtests.log
%doc doc/librpm/html/*
%changelog
* Mon May 28 2018 Miro Hrončok <mhroncok@redhat.com> - 4.14.1-10
- Backport upstream solution to make brp-python-bytecompile automagic part opt-outable
https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation
* Tue May 22 2018 Mark Wielaard <mjw@fedoraproject.org> - 4.14.1-9
- find-debuginfo.sh: Handle application/x-pie-executable (#1581224)