public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpm] pmatilai-v6: - Fix Python byte compilation for Python3 only packages
@ 2026-11-23 9:30 Florian Festi
0 siblings, 0 replies; only message in thread
From: Florian Festi @ 2026-11-23 9:30 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rpm
Branch : pmatilai-v6
Commit : e38c40157441819517392e6f1fab20299dd1e9d7
Author : Florian Festi <ffesti@redhat.com>
Date : 2017-02-14T14:25:11+01:00
Stats : +56/-2 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/rpm/c/e38c40157441819517392e6f1fab20299dd1e9d7?branch=pmatilai-v6
Log:
- Fix Python byte compilation for Python3 only packages
- Fixes #1411588
---
diff --git a/rpm-4.13.x-brp-python-bytecompile-Python3-only.patch b/rpm-4.13.x-brp-python-bytecompile-Python3-only.patch
new file mode 100644
index 0000000..56bc857
--- /dev/null
+++ b/rpm-4.13.x-brp-python-bytecompile-Python3-only.patch
@@ -0,0 +1,49 @@
+From a8e51b3bb05c6acb1d9b2e3d34f859ddda1677be Mon Sep 17 00:00:00 2001
+From: Florian Festi <ffesti@redhat.com>
+Date: Tue, 14 Feb 2017 14:04:35 +0100
+Subject: [PATCH] brp-python-bytecompile: Process python lib dirs even without
+ standard Python
+
+There is no need for /usr/bin/python when byte compiling files in
+/usr/lib/pythonX.Y (only /usr/bin/pythonX.Y). Moved check so we do not exit
+prematurely.
+
+Fixes: rhbz#1411588
+---
+ scripts/brp-python-bytecompile | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/scripts/brp-python-bytecompile b/scripts/brp-python-bytecompile
+index 838f23d..894fa34 100644
+--- a/scripts/brp-python-bytecompile
++++ b/scripts/brp-python-bytecompile
+@@ -6,12 +6,6 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
+ exit 0
+ fi
+
+-# If we don't have a python interpreter, avoid changing anything.
+-default_python=${1:-/usr/bin/python}
+-if [ ! -x "$default_python" ]; then
+- exit 0
+-fi
+-
+ # Figure out how deep we need to descend. We could pick an insanely high
+ # number and hope it's enough, but somewhere, somebody's sure to run into it.
+ depth=`(find "$RPM_BUILD_ROOT" -type f -name "*.py" -print0 ; echo /) | \
+@@ -86,7 +80,12 @@ done
+
+
+ # Handle other locations in the filesystem using the default python
+-# implementation:
++# implementation - if we have a default python interpreter
++
++default_python=${1:-/usr/bin/python}
++if [ ! -x "$default_python" ]; then
++ exit 0
++fi
+
+ # 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" "/"
+--
+2.5.5
+
diff --git a/rpm.spec b/rpm.spec
index d9c8f4f..6970a55 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -29,7 +29,7 @@
Summary: The RPM package management system
Name: rpm
Version: %{rpmver}
-Release: %{?snapver:0.%{snapver}.}11%{?dist}.1
+Release: %{?snapver:0.%{snapver}.}12%{?dist}
Group: System Environment/Base
Url: http://www.rpm.org/
Source0: http://rpm.org/releases/%{srcdir}/%{name}-%{srcver}.tar.bz2
@@ -63,9 +63,11 @@ Patch136: rpm-4.13.x-pythondistdeps.py-skip-distribution-metadata-if-ther.patch
Patch137: rpm-4.13.x-pythondistdeps.py-show-warning-if-version-is-not-fou.patch
Patch138: rpm-4.13.x-pythondistdeps.py-skip-.egg-link-files.patch
Patch139: rpm-4.13.x-pythondistdeps.py-add-forgotten-import.patch
+Patch140: rpm-4.13.x-brp-python-bytecompile-Python3-only.patch
# Fedora-specific (python3) patch (RHBZ #1405483)
-Patch140: rpm-4.13.x-pythondistdeps-python3.patch
+Patch200: rpm-4.13.x-pythondistdeps-python3.patch
+
# These are not yet upstream
Patch302: rpm-4.7.1-geode-i686.patch
@@ -567,6 +569,9 @@ exit 0
%doc doc/librpm/html/*
%changelog
+* Tue Feb 14 2017 Florian Festi <ffesti@rpm.org> - 4.13.0-12
+- Fix Python byte compilation for Python3 only packages (#1411588)
+
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.13.0-11.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-23 9:30 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:30 [rpms/rpm] pmatilai-v6: - Fix Python byte compilation for Python3 only packages Florian Festi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox