diff options
author | PJ Eby <distutils-sig@python.org> | 2005-03-21 20:41:57 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2005-03-21 20:41:57 +0000 |
commit | 8c07c4fa8d64fb78bafd892d9f963d8730fcba48 (patch) | |
tree | 6c58f2631724428bf4645cb91bd74b80fdd91d14 | |
parent | 6d85a801861c5834bf53cdf62be27aca9774e19b (diff) | |
download | external_python_setuptools-8c07c4fa8d64fb78bafd892d9f963d8730fcba48.tar.gz external_python_setuptools-8c07c4fa8d64fb78bafd892d9f963d8730fcba48.tar.bz2 external_python_setuptools-8c07c4fa8d64fb78bafd892d9f963d8730fcba48.zip |
Allow user-supplied metadata from EGG-INFO.in directory (directory name can
be overridden with a command-line option).
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4040991
-rw-r--r-- | setuptools/command/bdist_egg.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py index 7c98155b..d340c80a 100644 --- a/setuptools/command/bdist_egg.py +++ b/setuptools/command/bdist_egg.py @@ -16,7 +16,10 @@ class bdist_egg(Command): description = "create an \"egg\" distribution" - user_options = [('bdist-dir=', 'd', + user_options = [('egg-info=', 'e', + "directory containing EGG-INFO for the distribution " + "(default: EGG-INFO.in)"), + ('bdist-dir=', 'd', "temporary directory for creating the distribution"), ('plat-name=', 'p', "platform name to embed in generated filenames " @@ -37,6 +40,7 @@ class bdist_egg(Command): def initialize_options (self): + self.egg_info = None self.bdist_dir = None self.plat_name = None self.keep_temp = 0 @@ -49,6 +53,12 @@ class bdist_egg(Command): def finalize_options (self): + if self.egg_info is None and os.path.isdir('EGG-INFO.in'): + self.egg_info = 'EGG-INFO.in' + + elif self.egg_info: + self.ensure_dirname('egg_info') + if self.bdist_dir is None: bdist_base = self.get_finalized_command('bdist').bdist_base self.bdist_dir = os.path.join(bdist_base, 'egg') @@ -91,6 +101,12 @@ class bdist_egg(Command): egg_info = os.path.join(archive_root,'EGG-INFO') self.mkpath(egg_info) + if self.egg_info: + for filename in os.listdir(self.egg_info): + path = os.path.join(self.egg_info,filename) + if os.path.isfile(path): + self.copy_file(path,os.path.join(egg_info,filename)) + if not self.dry_run: self.distribution.metadata.write_pkg_info(egg_info) |