teknoraver / rpms / rpm

Forked from rpms/rpm 4 months ago
Clone

Blame rpm-4.13.x-brp-python-bytecompile-Python3-only.patch

Florian Festi e38c40
From a8e51b3bb05c6acb1d9b2e3d34f859ddda1677be Mon Sep 17 00:00:00 2001
Florian Festi e38c40
From: Florian Festi <ffesti@redhat.com>
Florian Festi e38c40
Date: Tue, 14 Feb 2017 14:04:35 +0100
Florian Festi e38c40
Subject: [PATCH] brp-python-bytecompile: Process python lib dirs even without
Florian Festi e38c40
 standard Python
Florian Festi e38c40
Florian Festi e38c40
There is no need for /usr/bin/python when byte compiling files in
Florian Festi e38c40
/usr/lib/pythonX.Y (only /usr/bin/pythonX.Y). Moved check so we do not exit
Florian Festi e38c40
prematurely.
Florian Festi e38c40
Florian Festi e38c40
Fixes: rhbz#1411588
Florian Festi e38c40
---
Florian Festi e38c40
 scripts/brp-python-bytecompile | 13 ++++++-------
Florian Festi e38c40
 1 file changed, 6 insertions(+), 7 deletions(-)
Florian Festi e38c40
Florian Festi e38c40
diff --git a/scripts/brp-python-bytecompile b/scripts/brp-python-bytecompile
Florian Festi e38c40
index 838f23d..894fa34 100644
Florian Festi e38c40
--- a/scripts/brp-python-bytecompile
Florian Festi e38c40
+++ b/scripts/brp-python-bytecompile
Florian Festi e38c40
@@ -6,12 +6,6 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
Florian Festi e38c40
 	exit 0
Florian Festi e38c40
 fi
Florian Festi e38c40
 
Florian Festi e38c40
-# If we don't have a python interpreter, avoid changing anything.
Florian Festi e38c40
-default_python=${1:-/usr/bin/python}
Florian Festi e38c40
-if [ ! -x "$default_python" ]; then
Florian Festi e38c40
-	exit 0
Florian Festi e38c40
-fi
Florian Festi e38c40
-
Florian Festi e38c40
 # Figure out how deep we need to descend.  We could pick an insanely high
Florian Festi e38c40
 # number and hope it's enough, but somewhere, somebody's sure to run into it.
Florian Festi e38c40
 depth=`(find "$RPM_BUILD_ROOT" -type f -name "*.py" -print0 ; echo /) | \
Florian Festi e38c40
@@ -86,7 +80,12 @@ done
Florian Festi e38c40
 
Florian Festi e38c40
 
Florian Festi e38c40
 # Handle other locations in the filesystem using the default python
Florian Festi e38c40
-# implementation:
Florian Festi e38c40
+# implementation - if we  have a default python interpreter
Florian Festi e38c40
+
Florian Festi e38c40
+default_python=${1:-/usr/bin/python}
Florian Festi e38c40
+if [ ! -x "$default_python" ]; then
Florian Festi e38c40
+	exit 0
Florian Festi e38c40
+fi
Florian Festi e38c40
 
Florian Festi e38c40
 # Generate normal (.pyc) byte-compiled files.
Florian Festi e38c40
 python_bytecompile "" $default_python "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]|/usr/share/doc" "$RPM_BUILD_ROOT" "$depth" "/"
Florian Festi e38c40
-- 
Florian Festi e38c40
2.5.5
Florian Festi e38c40