Changeset 391 for python/trunk/Lib/distutils/command/bdist.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/distutils/command/bdist.py
r2 r391 4 4 distribution).""" 5 5 6 # This module should be kept compatible with Python 2.1. 7 8 __revision__ = "$Id: bdist.py 62197 2008-04-07 01:53:39Z mark.hammond $" 6 __revision__ = "$Id$" 9 7 10 8 import os 11 from types import * 9 10 from distutils.util import get_platform 12 11 from distutils.core import Command 13 from distutils.errors import * 14 from distutils.util import get_platform 12 from distutils.errors import DistutilsPlatformError, DistutilsOptionError 15 13 16 14 17 def show_formats 15 def show_formats(): 18 16 """Print list of available formats (arguments to "--format" option). 19 17 """ 20 18 from distutils.fancy_getopt import FancyGetopt 21 formats =[]19 formats = [] 22 20 for format in bdist.format_commands: 23 21 formats.append(("formats=" + format, None, … … 27 25 28 26 29 class bdist 27 class bdist(Command): 30 28 31 29 description = "create a built (binary) distribution" … … 43 41 ('skip-build', None, 44 42 "skip rebuilding everything (for testing/debugging)"), 43 ('owner=', 'u', 44 "Owner name used when creating a tar file" 45 " [default: current user]"), 46 ('group=', 'g', 47 "Group name used when creating a tar file" 48 " [default: current group]"), 45 49 ] 46 50 … … 53 57 54 58 # The following commands do not take a format option from bdist 55 no_format_option = ('bdist_rpm', 56 #'bdist_sdux', 'bdist_pkgtool' 57 ) 59 no_format_option = ('bdist_rpm',) 58 60 59 61 # This won't do in reality: will need to distinguish RPM-ish Linux, 60 62 # Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS. 61 default_format = { 62 63 'os2': 'zip',}63 default_format = {'posix': 'gztar', 64 'nt': 'zip', 65 'os2': 'zip'} 64 66 65 67 # Establish the preferred order (for the --help-formats option). 66 68 format_commands = ['rpm', 'gztar', 'bztar', 'ztar', 'tar', 67 'wininst', 'zip', 68 #'pkgtool', 'sdux' 69 ] 69 'wininst', 'zip', 'msi'] 70 70 71 71 # And the real information. 72 format_command = { 'rpm': ('bdist_rpm', "RPM distribution"), 73 'zip': ('bdist_dumb', "ZIP file"), 74 'gztar': ('bdist_dumb', "gzip'ed tar file"), 75 'bztar': ('bdist_dumb', "bzip2'ed tar file"), 76 'ztar': ('bdist_dumb', "compressed tar file"), 77 'tar': ('bdist_dumb', "tar file"), 78 'wininst': ('bdist_wininst', 79 "Windows executable installer"), 80 'zip': ('bdist_dumb', "ZIP file"), 81 #'pkgtool': ('bdist_pkgtool', 82 # "Solaris pkgtool distribution"), 83 #'sdux': ('bdist_sdux', "HP-UX swinstall depot"), 72 format_command = {'rpm': ('bdist_rpm', "RPM distribution"), 73 'gztar': ('bdist_dumb', "gzip'ed tar file"), 74 'bztar': ('bdist_dumb', "bzip2'ed tar file"), 75 'ztar': ('bdist_dumb', "compressed tar file"), 76 'tar': ('bdist_dumb', "tar file"), 77 'wininst': ('bdist_wininst', 78 "Windows executable installer"), 79 'zip': ('bdist_dumb', "ZIP file"), 80 'msi': ('bdist_msi', "Microsoft Installer") 84 81 } 85 82 86 83 87 def initialize_options 84 def initialize_options(self): 88 85 self.bdist_base = None 89 86 self.plat_name = None … … 91 88 self.dist_dir = None 92 89 self.skip_build = 0 90 self.group = None 91 self.owner = None 93 92 94 # initialize_options() 95 96 97 def finalize_options (self): 93 def finalize_options(self): 98 94 # have to finalize 'plat_name' before 'bdist_base' 99 95 if self.plat_name is None: … … 123 119 self.dist_dir = "dist" 124 120 125 # finalize_options() 126 127 def run (self): 128 121 def run(self): 129 122 # Figure out which sub-commands we need to run. 130 123 commands = [] … … 142 135 sub_cmd.format = self.formats[i] 143 136 137 # passing the owner and group names for tar archiving 138 if cmd_name == 'bdist_dumb': 139 sub_cmd.owner = self.owner 140 sub_cmd.group = self.group 141 144 142 # If we're going to need to run this command again, tell it to 145 143 # keep its temporary files around so subsequent runs go faster. … … 147 145 sub_cmd.keep_temp = 1 148 146 self.run_command(cmd_name) 149 150 # run()151 152 # class bdist
Note:
See TracChangeset
for help on using the changeset viewer.