Commits

Anonymous committed b374dba

Fix for http://bugs.python.org/setuptools/issue9 (backport from trunk)

Comments (0)

Files changed (2)

setuptools/command/bdist_egg.py

             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')
             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()
         )

setuptools/command/egg_info.py

         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):
 
 
 
-
-
-
-
-
-
     def get_svn_revision(self):
         revision = 0
         urlre = re.compile('url="([^"]+)"')