[Python-checkins] python/nondist/sandbox/setuptools/setuptools/command bdist_egg.py, 1.12, 1.13

pje@users.sourceforge.net pje at users.sourceforge.net
Sun Jun 5 20:59:39 CEST 2005


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

Modified Files:
	bdist_egg.py 
Log Message:
Add "safe_name" and "safe_version" functions to allow sanitizing of
distribution names and versions in arbitrary packages that might be built
using EasyInstall.


Index: bdist_egg.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command/bdist_egg.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- bdist_egg.py	30 May 2005 23:22:10 -0000	1.12
+++ bdist_egg.py	5 Jun 2005 18:59:36 -0000	1.13
@@ -10,7 +10,7 @@
 from distutils.sysconfig import get_python_version, get_python_lib
 from distutils.errors import *
 from distutils import log
-from pkg_resources import parse_requirements, get_platform
+from pkg_resources import parse_requirements, get_platform, safe_name, safe_version
 
 class bdist_egg(Command):
     description = "create an \"egg\" distribution"
@@ -54,7 +54,7 @@
         self.tag_date = 0
 
     def finalize_options (self):
-        self.egg_name = self.distribution.get_name().replace(' ','-')
+        self.egg_name = safe_name(self.distribution.get_name())
         self.egg_version = self.tagged_version()
         try:
             list(
@@ -122,7 +122,6 @@
             self.distribution.data_files = old
 
     def run(self):
-
         if not self.skip_build:
             self.run_command('build')
 
@@ -161,6 +160,7 @@
             self.egg_version.replace('-','_'), get_python_version())
         if ext_outputs:
             archive_basename += "-" + self.plat_name
+            ext_outputs = [out.replace(os.sep,'/') for out in ext_outputs]
 
         # OS/2 objects to any ":" characters in a filename (such as when
         # a timestamp is used in a version) so change them to underscores.
@@ -223,7 +223,7 @@
             import time
             version += time.strftime("-%Y%m%d")
 
-        return version
+        return safe_version(version)
 
     def get_svn_revision(self):
         stdin, stdout = os.popen4("svn info"); stdin.close()



More information about the Python-checkins mailing list