diff options
Diffstat (limited to 'pythoneggs.py')
-rwxr-xr-x | pythoneggs.py | 12 |
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'): |