diff --git a/rpm-4.14.1-python-brp-bytecompile.patch b/rpm-4.14.1-python-brp-bytecompile.patch new file mode 100644 index 0000000..d99a271 --- /dev/null +++ b/rpm-4.14.1-python-brp-bytecompile.patch @@ -0,0 +1,15 @@ +diff --git a/scripts/brp-python-bytecompile b/scripts/brp-python-bytecompile +index 894fa3459..47776215a 100644 +--- a/scripts/brp-python-bytecompile ++++ b/scripts/brp-python-bytecompile +@@ -87,6 +87,10 @@ if [ ! -x "$default_python" ]; then + exit 0 + fi + ++# Figure out if there are files to be bytecompiled with the default_python at all ++# this prevents unnecessary default_python invocation ++find "$RPM_BUILD_ROOT" -type f -name "*.py" | grep -Ev "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]|/usr/share/doc" || exit 0 ++ + # Generate normal (.pyc) byte-compiled files. + python_bytecompile "" $default_python "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]|/usr/share/doc" "$RPM_BUILD_ROOT" "$depth" "/" + if [ $? -ne 0 -a 0$errors_terminate -ne 0 ]; then diff --git a/rpm.spec b/rpm.spec index 39cc35b..60c5eb2 100644 --- a/rpm.spec +++ b/rpm.spec @@ -23,7 +23,7 @@ %global rpmver 4.14.1 #global snapver rc2 -%global rel 3 +%global rel 4 %global srcver %{version}%{?snapver:-%{snapver}} %global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(echo %{version} | cut -d'.' -f1-2).x} @@ -56,6 +56,9 @@ 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 +# Upstream pull request: https://github.com/rpm-software-management/rpm/pull/383 +Patch6: rpm-4.14.1-python-brp-bytecompile.patch # Patches already upstream: @@ -575,6 +578,9 @@ make check || cat tests/rpmtests.log %doc doc/librpm/html/* %changelog +* Tue Jan 30 2018 Petr Viktorin - 4.14.1-4 +- Skip automatic Python byte-compilation if *.py files are not present + * Thu Jan 25 2018 Florian Weimer - 4.14.1-3 - Rebuild to work around gcc bug leading to librpm miscompilation (#1538648)