aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/bdist_egg.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2005-09-03 03:20:54 +0000
committerPJ Eby <distutils-sig@python.org>2005-09-03 03:20:54 +0000
commitff23de19b2189dc8cf0d7730034fa01667bda04a (patch)
treeb6cf7afac9ca7f69ff7cde057259e8779971cf38 /setuptools/command/bdist_egg.py
parent3dc12ca9d95d7b147e42ef028cc81939413bc34c (diff)
downloadexternal_python_setuptools-ff23de19b2189dc8cf0d7730034fa01667bda04a.tar.gz
external_python_setuptools-ff23de19b2189dc8cf0d7730034fa01667bda04a.tar.bz2
external_python_setuptools-ff23de19b2189dc8cf0d7730034fa01667bda04a.zip
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
Diffstat (limited to 'setuptools/command/bdist_egg.py')
-rw-r--r--setuptools/command/bdist_egg.py47
1 files changed, 44 insertions, 3 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py
index 0c5fae43..dd30ffbd 100644
--- a/setuptools/command/bdist_egg.py
+++ b/setuptools/command/bdist_egg.py
@@ -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)
@@ -285,6 +285,47 @@ class bdist_egg(Command):
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"""
walker = os.walk(egg_dir)