[Python-checkins] python/nondist/sandbox/setuptools/setuptools/command bdist_egg.py, 1.2, 1.3

pje at users.sourceforge.net pje at users.sourceforge.net
Mon Mar 21 21:42:14 CET 2005


Update of /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31636/setuptools/command

Modified Files:
	bdist_egg.py 
Log Message:
Allow user-supplied metadata from EGG-INFO.in directory (directory name can
be overridden with a command-line option).


Index: bdist_egg.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command/bdist_egg.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- bdist_egg.py	21 Mar 2005 20:12:33 -0000	1.2
+++ bdist_egg.py	21 Mar 2005 20:41:57 -0000	1.3
@@ -16,7 +16,10 @@
 
     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 @@
 
 
     def initialize_options (self):
+        self.egg_info = None
         self.bdist_dir = None
         self.plat_name = None
         self.keep_temp = 0
@@ -49,6 +53,12 @@
 
     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 @@
         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)
 



More information about the Python-checkins mailing list