Commit ff23de19 authored by PJ Eby's avatar PJ Eby

Work around a problem with SuSE Linux's patched install_lib command, by

figuring out the extension paths without its help.  :(

--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041234
parent 3dc12ca9
......@@ -173,9 +173,8 @@ class bdist_egg(Command):
old_root = instcmd.root; instcmd.root = None
cmd = self.call_command('install_lib', warn_dir=0)
instcmd.root = old_root
ext_outputs = cmd._mutate_outputs(
self.distribution.has_ext_modules(), 'build_ext', 'build_lib', ''
)
ext_outputs = self.get_ext_outputs()
self.stubs = []
to_compile = []
for (p,ext_name) in enumerate(ext_outputs):
......@@ -187,6 +186,7 @@ class bdist_egg(Command):
write_stub(os.path.basename(ext_name), pyfile)
to_compile.append(pyfile)
ext_outputs[p] = ext_name.replace(os.sep,'/')
to_compile.extend(self.make_init_files())
if to_compile:
cmd.byte_compile(to_compile)
......@@ -284,6 +284,47 @@ class bdist_egg(Command):
dirs[:] = []
return init_files
def get_ext_outputs(self):
"""Get a list of relative paths to C extensions in the output distro"""
if not self.distribution.has_ext_modules():
return []
build_cmd = self.get_finalized_command('build_ext')
prefix_len = len(build_cmd.build_lib) + len(os.sep)
outputs = []
for filename in build_cmd.get_outputs():
outputs.append(filename[prefix_len:])
return outputs
def walk_egg(egg_dir):
"""Walk an unpacked egg's contents, skipping the metadata directory"""
......
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