aboutsummaryrefslogtreecommitdiffstats
path: root/pythoneggs.py
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2010-10-20 01:20:28 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2010-10-20 01:20:28 +0000
commit8316ef1fd0fa4c482e82007880d6f8abc153876d (patch)
treef3fd868817d817c8d2de2dd9c58fa24418c52002 /pythoneggs.py
parent9b0a188147e96fa66b5b9bace83a610bf373424c (diff)
downloadrpm-setup-8316ef1fd0fa4c482e82007880d6f8abc153876d.tar
rpm-setup-8316ef1fd0fa4c482e82007880d6f8abc153876d.tar.gz
rpm-setup-8316ef1fd0fa4c482e82007880d6f8abc153876d.tar.bz2
rpm-setup-8316ef1fd0fa4c482e82007880d6f8abc153876d.tar.xz
rpm-setup-8316ef1fd0fa4c482e82007880d6f8abc153876d.zip
determine python(abi) version based on path
Diffstat (limited to 'pythoneggs.py')
-rwxr-xr-xpythoneggs.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/pythoneggs.py b/pythoneggs.py
index 4cf2245..a626873 100755
--- a/pythoneggs.py
+++ b/pythoneggs.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
from getopt import getopt
-from os.path import basename, dirname, isdir, splitext
+from os.path import basename, dirname, isdir, sep, splitext
from sys import argv, stdin, version
from pkg_resources import Distribution, FileMetadata, PathMetadata
from distutils.sysconfig import get_python_lib
@@ -50,14 +50,16 @@ else:
files = stdin.readlines()
for f in files:
f = f.strip()
- #if Requires:
- # if get_python_lib(plat_specific=1) in f or get_python_lib() in f:
- # print 'python(abi) >= %s' % Version
lower = f.lower()
name = 'python(abi)'
- if py_abi and lower.endswith('.py'):
+ if py_abi and (lower.endswith('.py') or lower.endswith('.pyc') or lower.endswith('.pyo')):
if not name in py_deps:
py_deps[name] = []
+ purelib = get_python_lib(standard_lib=1, plat_specific=0).split(version[:3])[0]
+ platlib = get_python_lib(standard_lib=1, plat_specific=1).split(version[:3])[0]
+ for lib in (purelib, platlib):
+ if lib in f:
+ py_deps[name].append(('==',f.split(lib)[1].split(sep)[0]))
if lower.endswith('.egg') or \
lower.endswith('.egg-info') or \
lower.endswith('.egg-link'):