[Python-checkins] python/dist/src/Lib/distutils/command bdist_dumb.py, 1.26, 1.27 bdist_rpm.py, 1.47, 1.48 bdist_wininst.py, 1.58, 1.59 sdist.py, 1.60, 1.61 upload.py, 1.5, 1.6

loewis at users.sourceforge.net loewis at users.sourceforge.net
Wed Mar 23 19:55:37 CET 2005


Update of /cvsroot/python/python/dist/src/Lib/distutils/command
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11294/command

Modified Files:
	bdist_dumb.py bdist_rpm.py bdist_wininst.py sdist.py upload.py 
Log Message:
Make dist_files a triple, with the Python target version included,
so that bdist_wininst can specify 'any'.


Index: bdist_dumb.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/bdist_dumb.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- bdist_dumb.py	21 Mar 2005 20:56:30 -0000	1.26
+++ bdist_dumb.py	23 Mar 2005 18:54:08 -0000	1.27
@@ -13,6 +13,7 @@
 from distutils.util import get_platform
 from distutils.dir_util import create_tree, remove_tree, ensure_relative
 from distutils.errors import *
+from distutils.sysconfig import get_python_version
 from distutils import log
 
 class bdist_dumb (Command):
@@ -119,7 +120,12 @@
         # Make the archive
         filename = self.make_archive(pseudoinstall_root,
                                      self.format, root_dir=archive_root)
-        self.distribution.dist_files.append(('bdist_dumb', filename))
+        if self.distribution.has_ext_modules():
+            pyversion = get_python_version()
+        else:
+            pyversion = 'any'
+        self.distribution.dist_files.append(('bdist_dumb', pyversion,
+                                             filename))
 
         if not self.keep_temp:
             remove_tree(self.bdist_dir, dry_run=self.dry_run)

Index: bdist_rpm.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/bdist_rpm.py,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- bdist_rpm.py	21 Mar 2005 20:56:31 -0000	1.47
+++ bdist_rpm.py	23 Mar 2005 18:54:10 -0000	1.48
@@ -15,6 +15,7 @@
 from distutils.util import get_platform
 from distutils.file_util import write_file
 from distutils.errors import *
+from distutils.sysconfig import get_python_version
 from distutils import log
 
 class bdist_rpm (Command):
@@ -346,6 +347,10 @@
                 srpms = glob.glob(os.path.join(rpm_dir['SRPMS'], "*.rpm"))
                 assert len(srpms) == 1, \
                        "unexpected number of SRPM files found: %s" % srpms
+                dist_file = ('bdist_rpm', '',
+                             os.path.join(self.dist_dir,
+                                          os.path.basename(srpms[0])))
+                self.distribution.dist_files.append(dist_file)
                 self.move_file(srpms[0], self.dist_dir)
 
             if not self.source_only:
@@ -356,9 +361,15 @@
                     rpms.remove(debuginfo[0])
                 assert len(rpms) == 1, \
                        "unexpected number of RPM files found: %s" % rpms
+                dist_file = ('bdist_rpm', get_python_version(),
+                             os.path.join(self.dist_dir,
+                                          os.path.basename(rpms[0])))
+                self.distribution.dist_files.append(dist_file)
                 self.move_file(rpms[0], self.dist_dir)
-                self.distribution.dist_files.append(('bdist_rpm', rpms[0]))
                 if debuginfo:
+                    dist_file = ('bdist_rpm', get_python_version(),
+                                 os.path.join(self.dist_dir,
+                                              os.path.basename(debuginfo[0])))
                     self.move_file(debuginfo[0], self.dist_dir)
     # run()
 

Index: bdist_wininst.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/bdist_wininst.py,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- bdist_wininst.py	22 Mar 2005 22:23:29 -0000	1.58
+++ bdist_wininst.py	23 Mar 2005 18:54:13 -0000	1.59
@@ -162,7 +162,11 @@
                                     root_dir=self.bdist_dir)
         # create an exe containing the zip-file
         self.create_exe(arcname, fullname, self.bitmap)
-        self.distribution.dist_files.append(('bdist_wininst', 
+        if self.distribution.has_ext_modules():
+            pyversion = get_python_version()
+        else:
+            pyversion = 'any'
+        self.distribution.dist_files.append(('bdist_wininst', pyversion,
                                              self.get_installer_filename(fullname)))
         # remove the zip-file again
         log.debug("removing temporary file '%s'", arcname)

Index: sdist.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/sdist.py,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- sdist.py	21 Mar 2005 20:56:34 -0000	1.60
+++ sdist.py	23 Mar 2005 18:54:35 -0000	1.61
@@ -449,7 +449,7 @@
         for fmt in self.formats:
             file = self.make_archive(base_name, fmt, base_dir=base_dir)
             archive_files.append(file)
-            self.distribution.dist_files.append(('sdist',file))
+            self.distribution.dist_files.append(('sdist', '', file))
 
         self.archive_files = archive_files
 

Index: upload.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/upload.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- upload.py	22 Mar 2005 23:02:54 -0000	1.5
+++ upload.py	23 Mar 2005 18:54:36 -0000	1.6
@@ -4,7 +4,6 @@
 
 from distutils.errors import *
 from distutils.core import Command
-from distutils.sysconfig import get_python_version
 from distutils.spawn import spawn
 from distutils import log
 from md5 import md5
@@ -61,10 +60,10 @@
     def run(self):
         if not self.distribution.dist_files:
             raise DistutilsOptionError("No dist file created in earlier command")
-        for command, filename in self.distribution.dist_files:
-            self.upload_file(command, filename)
+        for command, pyversion, filename in self.distribution.dist_files:
+            self.upload_file(command, pyversion, filename)
 
-    def upload_file(self, command, filename):
+    def upload_file(self, command, pyversion, filename):
         # Sign if requested
         if self.sign:
             spawn(("gpg", "--detach-sign", "-a", filename),
@@ -79,7 +78,7 @@
             'version':self.distribution.get_version(),
             'content':(os.path.basename(filename),content),
             'filetype':command,
-            'pyversion':get_python_version(),
+            'pyversion':pyversion,
             'md5_digest':md5(content).hexdigest(),
             }
         comment = ''
@@ -89,8 +88,6 @@
                 comment = 'built for %s %s' % (dist, version)
         elif command == 'bdist_dumb':
             comment = 'built for %s' % platform.platform(terse=1)
-        elif command == 'sdist':
-            data['pyversion'] = ''
         data['comment'] = comment
 
         if self.sign:



More information about the Python-checkins mailing list