aboutsummaryrefslogtreecommitdiffstats
path: root/pythoneggs.py
diff options
context:
space:
mode:
Diffstat (limited to 'pythoneggs.py')
-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)