[Python-checkins] python/nondist/sandbox/setuptools/setuptools/command bdist_egg.py, 1.30, 1.31
pje@users.sourceforge.net
pje at users.sourceforge.net
Sat Sep 3 05:21:06 CEST 2005
Update of /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32206/setuptools/command
Modified Files:
bdist_egg.py
Log Message:
Work around a problem with SuSE Linux's patched install_lib command, by
figuring out the extension paths without its help. :(
Index: bdist_egg.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command/bdist_egg.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- bdist_egg.py 23 Aug 2005 13:24:42 -0000 1.30
+++ bdist_egg.py 3 Sep 2005 03:20:54 -0000 1.31
@@ -173,9 +173,8 @@
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 @@
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 @@
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)
More information about the Python-checkins
mailing list