Commit 8c07c4fa authored by PJ Eby's avatar PJ Eby

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
parent 6d85a801
...@@ -16,7 +16,10 @@ class bdist_egg(Command): ...@@ -16,7 +16,10 @@ class bdist_egg(Command):
description = "create an \"egg\" distribution" 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"), "temporary directory for creating the distribution"),
('plat-name=', 'p', ('plat-name=', 'p',
"platform name to embed in generated filenames " "platform name to embed in generated filenames "
...@@ -37,6 +40,7 @@ class bdist_egg(Command): ...@@ -37,6 +40,7 @@ class bdist_egg(Command):
def initialize_options (self): def initialize_options (self):
self.egg_info = None
self.bdist_dir = None self.bdist_dir = None
self.plat_name = None self.plat_name = None
self.keep_temp = 0 self.keep_temp = 0
...@@ -49,6 +53,12 @@ class bdist_egg(Command): ...@@ -49,6 +53,12 @@ class bdist_egg(Command):
def finalize_options (self): 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: if self.bdist_dir is None:
bdist_base = self.get_finalized_command('bdist').bdist_base bdist_base = self.get_finalized_command('bdist').bdist_base
self.bdist_dir = os.path.join(bdist_base, 'egg') self.bdist_dir = os.path.join(bdist_base, 'egg')
...@@ -91,6 +101,12 @@ class bdist_egg(Command): ...@@ -91,6 +101,12 @@ class bdist_egg(Command):
egg_info = os.path.join(archive_root,'EGG-INFO') egg_info = os.path.join(archive_root,'EGG-INFO')
self.mkpath(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: if not self.dry_run:
self.distribution.metadata.write_pkg_info(egg_info) self.distribution.metadata.write_pkg_info(egg_info)
......
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