public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Petr Viktorin <pviktori@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/rpm] pmatilai-v6: Skip automatic Python byte-compilation if *.py files are not present
Date: Mon, 23 Nov 2026 09:31:46 GMT	[thread overview]
Message-ID: <179542630602.1.16821940456195606701.rpms-rpm-3f65cd7a4136@fedoraproject.org> (raw)

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)
 

                 reply	other threads:[~2026-11-23  9:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179542630602.1.16821940456195606701.rpms-rpm-3f65cd7a4136@fedoraproject.org \
    --to=pviktori@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox