public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpm] pmatilai-v6: Skip automatic Python byte-compilation if *.py files are not present
@ 2026-11-23  9:31 Petr Viktorin
  0 siblings, 0 replies; only message in thread
From: Petr Viktorin @ 2026-11-23  9:31 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : 3f65cd7a413643298a61a6ea64430cc0a4566449
Author : Petr Viktorin <pviktori@redhat.com>
Date   : 2018-01-30T10:48:34+01:00
Stats  : +22/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/3f65cd7a413643298a61a6ea64430cc0a4566449?branch=pmatilai-v6

Log:
Skip automatic Python byte-compilation if *.py files are not present

---
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 <pviktori@redhat.com> - 4.14.1-4
+- Skip automatic Python byte-compilation if *.py files are not present
+
 * Thu Jan 25 2018 Florian Weimer <fweimer@redhat.com> - 4.14.1-3
 - Rebuild to work around gcc bug leading to librpm miscompilation (#1538648)
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-23  9:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23  9:31 [rpms/rpm] pmatilai-v6: Skip automatic Python byte-compilation if *.py files are not present Petr Viktorin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox