Commit e15ee4d4 authored by PJ Eby's avatar PJ Eby

Add experimental 'install_data' support to 'bdist_egg'. The most common

distutils custom command hack in the field is to make 'install_data'
put data in with the target packages by changing the --install-data to
match --install-lib, so this should let bdist_egg work with more packages
"out of the box".

--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041016
parent 02786fee
......@@ -96,35 +96,18 @@ class bdist_egg(Command):
f.close()
def run(self):
if not self.skip_build:
self.run_command('build')
if self.distribution.data_files:
install = self.reinitialize_command('install_data')
install.install_dir = self.bdist_dir
install.force = 0
install.root = None
log.info("installing package data to %s" % self.bdist_dir)
self.run_command('install_data')
install = self.reinitialize_command('install_lib', reinit_subcommands=1)
install.install_dir = self.bdist_dir
install.skip_build = self.skip_build
......@@ -134,9 +117,10 @@ class bdist_egg(Command):
install._mutate_outputs(self.distribution.has_ext_modules(),
'build_ext', 'build_lib',
'')
log.info("installing to %s" % self.bdist_dir)
log.info("installing library code to %s" % self.bdist_dir)
self.run_command('install_lib')
to_compile = []
for ext_name in ext_outputs:
filename,ext = os.path.splitext(ext_name)
......@@ -174,6 +158,10 @@ class bdist_egg(Command):
if not self.dry_run:
self.distribution.metadata.write_pkg_info(self.egg_info)
native_libs = os.path.join(self.egg_info,"native_libs.txt")
if ext_outputs:
log.info("writing %s" % native_libs)
......@@ -193,6 +181,8 @@ class bdist_egg(Command):
if os.path.isfile(path):
self.copy_file(path,os.path.join(egg_info,filename))
# Make the archive
make_zipfile(pseudoinstall_root+'.egg',
archive_root, verbose=self.verbose,
......@@ -203,6 +193,16 @@ class bdist_egg(Command):
def make_zipfile (zip_filename, base_dir, verbose=0, dry_run=0):
"""Create a zip file from all the files under 'base_dir'. The output
zip file will be named 'base_dir' + ".zip". Uses either the "zipfile"
......
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