[Python-checkins] r65954 - in sandbox/trunk/setuptools/setuptools/command: bdist_egg.py egg_info.py

phillip.eby python-checkins at python.org
Thu Aug 21 21:19:25 CEST 2008


Author: phillip.eby
Date: Thu Aug 21 21:19:24 2008
New Revision: 65954

Log:
Fix for http://bugs.python.org/setuptools/issue9


Modified:
   sandbox/trunk/setuptools/setuptools/command/bdist_egg.py
   sandbox/trunk/setuptools/setuptools/command/egg_info.py

Modified: sandbox/trunk/setuptools/setuptools/command/bdist_egg.py
==============================================================================
--- sandbox/trunk/setuptools/setuptools/command/bdist_egg.py	(original)
+++ sandbox/trunk/setuptools/setuptools/command/bdist_egg.py	Thu Aug 21 21:19:24 2008
@@ -203,10 +203,12 @@
             log.info("installing scripts to %s" % script_dir)
             self.call_command('install_scripts',install_dir=script_dir,no_ep=1)
 
-        native_libs = os.path.join(self.egg_info,"native_libs.txt")
+        self.copy_metadata_to(egg_info)
+        native_libs = os.path.join(egg_info, "native_libs.txt")
         if all_outputs:
             log.info("writing %s" % native_libs)
             if not self.dry_run:
+                ensure_directory(native_libs)
                 libs_file = open(native_libs, 'wt')
                 libs_file.write('\n'.join(all_outputs))
                 libs_file.write('\n')
@@ -216,8 +218,6 @@
             if not self.dry_run:
                 os.unlink(native_libs)
 
-        self.copy_metadata_to(egg_info)
-
         write_safety_flag(
             os.path.join(archive_root,'EGG-INFO'), self.zip_safe()
         )

Modified: sandbox/trunk/setuptools/setuptools/command/egg_info.py
==============================================================================
--- sandbox/trunk/setuptools/setuptools/command/egg_info.py	(original)
+++ sandbox/trunk/setuptools/setuptools/command/egg_info.py	Thu Aug 21 21:19:24 2008
@@ -168,6 +168,12 @@
         for ep in iter_entry_points('egg_info.writers'):
             writer = ep.load(installer=installer)
             writer(self, ep.name, os.path.join(self.egg_info,ep.name))
+
+        # Get rid of native_libs.txt if it was put there by older bdist_egg
+        nl = os.path.join(self.egg_info, "native_libs.txt")
+        if os.path.exists(nl):
+            self.delete_file(nl)
+
         self.find_sources()
 
     def tags(self):
@@ -197,12 +203,6 @@
 
 
 
-
-
-
-
-
-
     def get_svn_revision(self):
         revision = 0
         urlre = re.compile('url="([^"]+)"')


More information about the Python-checkins mailing list