teknoraver / rpms / rpm

Forked from rpms/rpm 4 months ago
Clone
Blob Blame History Raw
From eb48f08dd30324f960b8e404b80eb885b2bbb593 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Thu, 24 Aug 2017 13:45:49 +0200
Subject: [PATCH] Do not provide pythonXdist for platform-python packages

---
 scripts/pythondistdeps.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/pythondistdeps.py b/scripts/pythondistdeps.py
index 2abb59f49..f624fdbb7 100755
--- a/scripts/pythondistdeps.py
+++ b/scripts/pythondistdeps.py
@@ -16,6 +16,7 @@ from os.path import basename, dirname, isdir, sep
 from sys import argv, stdin, version
 from distutils.sysconfig import get_python_lib
 from warnings import warn
+import re
 
 
 opts, args = getopt(
@@ -78,6 +79,9 @@ for f in files:
     f = f.strip()
     lower = f.lower()
     name = 'python(abi)'
+    if re.search(r'/usr/lib(64)?/platform-python\d\.\d', lower):
+        # https://bugzilla.redhat.com/show_bug.cgi?id=1484607
+        continue
     # add dependency based on path, versioned if within versioned python directory
     if py_abi and (lower.endswith('.py') or lower.endswith('.pyc') or lower.endswith('.pyo')):
         if name not in py_deps:
@@ -115,7 +119,6 @@ for f in files:
         if not dist.py_version:
             # Try to parse the Python version from the path the metadata
             # resides at (e.g. /usr/lib/pythonX.Y/site-packages/...)
-            import re
             res = re.search(r"/python(?P<pyver>\d+\.\d)/", path_item)
             if res:
                 dist.py_version = res.group('pyver')
-- 
2.13.5