Commit a8ab614c authored by PJ Eby's avatar PJ Eby

Support complex .pth files in win32.exe->.egg conversion; this addition

lets easy_install handle pywin32...  well, almost.  You still have to
deal with the "system" DLLs yourself.

--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4043417
parent 176f17c6
...@@ -1291,13 +1291,14 @@ def get_exe_prefixes(exe_filename): ...@@ -1291,13 +1291,14 @@ def get_exe_prefixes(exe_filename):
if name.endswith('-nspkg.pth'): if name.endswith('-nspkg.pth'):
continue continue
if parts[0] in ('PURELIB','PLATLIB'): if parts[0] in ('PURELIB','PLATLIB'):
pth = z.read(name).strip() for pth in yield_lines(z.read(name)):
prefixes[0] = ('PURELIB/%s/' % pth), '' pth = pth.strip().replace('\\','/')
prefixes[1] = ('PLATLIB/%s/' % pth), '' if not pth.startswith('import'):
break prefixes.append((('%s/%s/' % (parts[0],pth)), ''))
finally: finally:
z.close() z.close()
prefixes.sort(); prefixes.reverse()
return prefixes return prefixes
...@@ -1309,7 +1310,6 @@ def parse_requirement_arg(spec): ...@@ -1309,7 +1310,6 @@ def parse_requirement_arg(spec):
"Not a URL, existing file, or requirement spec: %r" % (spec,) "Not a URL, existing file, or requirement spec: %r" % (spec,)
) )
class PthDistributions(Environment): class PthDistributions(Environment):
"""A .pth file with Distribution paths in it""" """A .pth file with Distribution paths in it"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment