aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2014-09-26 08:32:51 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2014-09-26 08:34:05 +0200
commit8a1cd92c00d5e9eddb5e4e61aa6b894786541b8d (patch)
tree02bb5776e5910925a038850f74c317fe20e5cba8
parent3d7cd6992f6d987b3c96d3616c26480a854968cf (diff)
downloadrpm-setup-8a1cd92c00d5e9eddb5e4e61aa6b894786541b8d.tar
rpm-setup-8a1cd92c00d5e9eddb5e4e61aa6b894786541b8d.tar.gz
rpm-setup-8a1cd92c00d5e9eddb5e4e61aa6b894786541b8d.tar.bz2
rpm-setup-8a1cd92c00d5e9eddb5e4e61aa6b894786541b8d.tar.xz
rpm-setup-8a1cd92c00d5e9eddb5e4e61aa6b894786541b8d.zip
fix emitting pythoneggs deps with internal generator
with internal generator we only get list of matching files but we'll never get any matching directory => check parent directory
-rwxr-xr-xpythoneggs.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/pythoneggs.py b/pythoneggs.py
index b03304e..23a595f 100755
--- a/pythoneggs.py
+++ b/pythoneggs.py
@@ -11,7 +11,7 @@
from getopt import getopt
from os.path import basename, dirname, isdir, sep, splitext
-from sys import argv, stdin, version
+from sys import argv, stderr, stdin, version
from pkg_resources import Distribution, FileMetadata, PathMetadata
from distutils.sysconfig import get_python_lib
@@ -73,14 +73,19 @@ for f in files:
spec = ('==',f.split(lib)[1].split(sep)[0])
if not spec in py_deps[name]:
py_deps[name].append(spec)
+ parent_name = dirname(f)
# Determine provide, requires, conflicts & suggests based on egg metadata
- if lower.endswith('.egg') or \
+ file_match = lower.endswith('.egg') or \
lower.endswith('.egg-info') or \
- lower.endswith('.egg-link'):
+ lower.endswith('.egg-link')
+ dir_match = parent_name.endswith('.egg') or \
+ parent_name.endswith('.egg-info') or \
+ parent_name.endswith('.egg-link')
+ if file_match or dir_match:
dist_name = basename(f)
- if isdir(f):
- path_item = dirname(f)
- metadata = PathMetadata(path_item, f)
+ if dir_match:
+ path_item = dirname(parent_name)
+ metadata = PathMetadata(path_item, parent_name)
else:
path_item = f
metadata = FileMetadata(f)