mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Merged revisions 71291 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r71291 | tarek.ziade | 2009-04-06 00:51:09 +0200 (Mon, 06 Apr 2009) | 1 line Fixed #5095: msi missing from Distutils bdist formats ........
This commit is contained in:
		
							parent
							
								
									0d8f07305d
								
							
						
					
					
						commit
						f637050f79
					
				
					 4 changed files with 67 additions and 25 deletions
				
			
		| 
						 | 
					@ -80,7 +80,7 @@ The available formats for built distributions are:
 | 
				
			||||||
+-------------+------------------------------+---------+
 | 
					+-------------+------------------------------+---------+
 | 
				
			||||||
| ``tar``     | tar file (:file:`.tar`)      | \(3)    |
 | 
					| ``tar``     | tar file (:file:`.tar`)      | \(3)    |
 | 
				
			||||||
+-------------+------------------------------+---------+
 | 
					+-------------+------------------------------+---------+
 | 
				
			||||||
| ``zip``     | zip file (:file:`.zip`)      | \(4)    |
 | 
					| ``zip``     | zip file (:file:`.zip`)      | (2),(4) |
 | 
				
			||||||
+-------------+------------------------------+---------+
 | 
					+-------------+------------------------------+---------+
 | 
				
			||||||
| ``rpm``     | RPM                          | \(5)    |
 | 
					| ``rpm``     | RPM                          | \(5)    |
 | 
				
			||||||
+-------------+------------------------------+---------+
 | 
					+-------------+------------------------------+---------+
 | 
				
			||||||
| 
						 | 
					@ -90,9 +90,12 @@ The available formats for built distributions are:
 | 
				
			||||||
+-------------+------------------------------+---------+
 | 
					+-------------+------------------------------+---------+
 | 
				
			||||||
| ``rpm``     | RPM                          | \(5)    |
 | 
					| ``rpm``     | RPM                          | \(5)    |
 | 
				
			||||||
+-------------+------------------------------+---------+
 | 
					+-------------+------------------------------+---------+
 | 
				
			||||||
| ``wininst`` | self-extracting ZIP file for | (2),(4) |
 | 
					| ``wininst`` | self-extracting ZIP file for | \(4)    |
 | 
				
			||||||
|             | Windows                      |         |
 | 
					|             | Windows                      |         |
 | 
				
			||||||
+-------------+------------------------------+---------+
 | 
					+-------------+------------------------------+---------+
 | 
				
			||||||
 | 
					| ``msi``     | Microsoft Installer.         |         |
 | 
				
			||||||
 | 
					+-------------+------------------------------+---------+
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -102,8 +105,6 @@ Notes:
 | 
				
			||||||
(2)
 | 
					(2)
 | 
				
			||||||
   default on Windows
 | 
					   default on Windows
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   **\*\*** to-do! **\*\***
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(3)
 | 
					(3)
 | 
				
			||||||
   requires external utilities: :program:`tar` and possibly one of :program:`gzip`,
 | 
					   requires external utilities: :program:`tar` and possibly one of :program:`gzip`,
 | 
				
			||||||
   :program:`bzip2`, or :program:`compress`
 | 
					   :program:`bzip2`, or :program:`compress`
 | 
				
			||||||
| 
						 | 
					@ -133,6 +134,8 @@ generates all the "dumb" archive formats (``tar``, ``ztar``, ``gztar``, and
 | 
				
			||||||
+--------------------------+-----------------------+
 | 
					+--------------------------+-----------------------+
 | 
				
			||||||
| :command:`bdist_wininst` | wininst               |
 | 
					| :command:`bdist_wininst` | wininst               |
 | 
				
			||||||
+--------------------------+-----------------------+
 | 
					+--------------------------+-----------------------+
 | 
				
			||||||
 | 
					| :command:`bdist_msi`     | msi                   |
 | 
				
			||||||
 | 
					+--------------------------+-----------------------+
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The following sections give details on the individual :command:`bdist_\*`
 | 
					The following sections give details on the individual :command:`bdist_\*`
 | 
				
			||||||
commands.
 | 
					commands.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -49,35 +49,28 @@ class bdist(Command):
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # The following commands do not take a format option from bdist
 | 
					    # The following commands do not take a format option from bdist
 | 
				
			||||||
    no_format_option = ('bdist_rpm',
 | 
					    no_format_option = ('bdist_rpm',)
 | 
				
			||||||
                        #'bdist_sdux', 'bdist_pkgtool'
 | 
					 | 
				
			||||||
                        )
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # This won't do in reality: will need to distinguish RPM-ish Linux,
 | 
					    # This won't do in reality: will need to distinguish RPM-ish Linux,
 | 
				
			||||||
    # Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
 | 
					    # Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
 | 
				
			||||||
    default_format = { 'posix': 'gztar',
 | 
					    default_format = {'posix': 'gztar',
 | 
				
			||||||
                       'nt': 'zip',
 | 
					                      'nt': 'zip',
 | 
				
			||||||
                       'os2': 'zip', }
 | 
					                      'os2': 'zip'}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Establish the preferred order (for the --help-formats option).
 | 
					    # Establish the preferred order (for the --help-formats option).
 | 
				
			||||||
    format_commands = ['rpm', 'gztar', 'bztar', 'ztar', 'tar',
 | 
					    format_commands = ['rpm', 'gztar', 'bztar', 'ztar', 'tar',
 | 
				
			||||||
                       'wininst', 'zip',
 | 
					                       'wininst', 'zip', 'msi']
 | 
				
			||||||
                       #'pkgtool', 'sdux'
 | 
					 | 
				
			||||||
                       ]
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # And the real information.
 | 
					    # And the real information.
 | 
				
			||||||
    format_command = { 'rpm':   ('bdist_rpm',  "RPM distribution"),
 | 
					    format_command = {'rpm':   ('bdist_rpm',  "RPM distribution"),
 | 
				
			||||||
                       'zip':   ('bdist_dumb', "ZIP file"),
 | 
					                      'gztar': ('bdist_dumb', "gzip'ed tar file"),
 | 
				
			||||||
                       'gztar': ('bdist_dumb', "gzip'ed tar file"),
 | 
					                      'bztar': ('bdist_dumb', "bzip2'ed tar file"),
 | 
				
			||||||
                       'bztar': ('bdist_dumb', "bzip2'ed tar file"),
 | 
					                      'ztar':  ('bdist_dumb', "compressed tar file"),
 | 
				
			||||||
                       'ztar':  ('bdist_dumb', "compressed tar file"),
 | 
					                      'tar':   ('bdist_dumb', "tar file"),
 | 
				
			||||||
                       'tar':   ('bdist_dumb', "tar file"),
 | 
					                      'wininst': ('bdist_wininst',
 | 
				
			||||||
                       'wininst': ('bdist_wininst',
 | 
					                                  "Windows executable installer"),
 | 
				
			||||||
                                   "Windows executable installer"),
 | 
					                      'zip':   ('bdist_dumb', "ZIP file"),
 | 
				
			||||||
                       'zip':   ('bdist_dumb', "ZIP file"),
 | 
					                      'msi':   ('bdist_msi',  "Microsoft Installer")
 | 
				
			||||||
                       #'pkgtool': ('bdist_pkgtool',
 | 
					 | 
				
			||||||
                       #            "Solaris pkgtool distribution"),
 | 
					 | 
				
			||||||
                       #'sdux':  ('bdist_sdux', "HP-UX swinstall depot"),
 | 
					 | 
				
			||||||
                      }
 | 
					                      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										43
									
								
								Lib/distutils/tests/test_bdist.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								Lib/distutils/tests/test_bdist.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,43 @@
 | 
				
			||||||
 | 
					"""Tests for distutils.command.bdist."""
 | 
				
			||||||
 | 
					import unittest
 | 
				
			||||||
 | 
					import sys
 | 
				
			||||||
 | 
					import os
 | 
				
			||||||
 | 
					import tempfile
 | 
				
			||||||
 | 
					import shutil
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from distutils.core import Distribution
 | 
				
			||||||
 | 
					from distutils.command.bdist import bdist
 | 
				
			||||||
 | 
					from distutils.tests import support
 | 
				
			||||||
 | 
					from distutils.spawn import find_executable
 | 
				
			||||||
 | 
					from distutils import spawn
 | 
				
			||||||
 | 
					from distutils.errors import DistutilsExecError
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class BuildTestCase(support.TempdirManager,
 | 
				
			||||||
 | 
					                    unittest.TestCase):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_formats(self):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # let's create a command and make sure
 | 
				
			||||||
 | 
					        # we can fix the format
 | 
				
			||||||
 | 
					        pkg_pth, dist = self.create_dist()
 | 
				
			||||||
 | 
					        cmd = bdist(dist)
 | 
				
			||||||
 | 
					        cmd.formats = ['msi']
 | 
				
			||||||
 | 
					        cmd.ensure_finalized()
 | 
				
			||||||
 | 
					        self.assertEquals(cmd.formats, ['msi'])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # what format bdist offers ?
 | 
				
			||||||
 | 
					        # XXX an explicit list in bdist is
 | 
				
			||||||
 | 
					        # not the best way to  bdist_* commands
 | 
				
			||||||
 | 
					        # we should add a registry
 | 
				
			||||||
 | 
					        formats = ['rpm', 'zip', 'gztar', 'bztar', 'ztar',
 | 
				
			||||||
 | 
					                   'tar', 'wininst', 'msi']
 | 
				
			||||||
 | 
					        formats.sort()
 | 
				
			||||||
 | 
					        founded = list(cmd.format_command.keys())
 | 
				
			||||||
 | 
					        founded.sort()
 | 
				
			||||||
 | 
					        self.assertEquals(founded, formats)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def test_suite():
 | 
				
			||||||
 | 
					    return unittest.makeSuite(BuildTestCase)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if __name__ == '__main__':
 | 
				
			||||||
 | 
					    test_support.run_unittest(test_suite())
 | 
				
			||||||
| 
						 | 
					@ -327,6 +327,9 @@ Core and Builtins
 | 
				
			||||||
Library
 | 
					Library
 | 
				
			||||||
-------
 | 
					-------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Issue #5095: Added bdist_msi to the list of bdist supported formats.
 | 
				
			||||||
 | 
					  Initial fix by Steven Bethard.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- Issue #1491431: Fixed distutils.filelist.glob_to_re for edge cases.
 | 
					- Issue #1491431: Fixed distutils.filelist.glob_to_re for edge cases.
 | 
				
			||||||
  Initial fix by Wayne Davison.
 | 
					  Initial fix by Wayne Davison.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue