Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(172927)

Side by Side Diff: Lib/distutils/command/bdist_dumb.py

Issue 6516: reset owner/group to root for distutils tarballs
Patch Set: Created 5 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/distutils/cmd.py ('k') | Lib/distutils/command/bdist.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """distutils.command.bdist_dumb 1 """distutils.command.bdist_dumb
2 2
3 Implements the Distutils 'bdist_dumb' command (create a "dumb" built 3 Implements the Distutils 'bdist_dumb' command (create a "dumb" built
4 distribution -- i.e., just an archive to be unpacked under $prefix or 4 distribution -- i.e., just an archive to be unpacked under $prefix or
5 $exec_prefix).""" 5 $exec_prefix)."""
6 6
7 import os 7 import os
8 from distutils.core import Command 8 from distutils.core import Command
9 from distutils.util import get_platform 9 from distutils.util import get_platform
10 from distutils.dir_util import remove_tree, ensure_relative 10 from distutils.dir_util import remove_tree, ensure_relative
(...skipping 15 matching lines...) Expand all
26 ('keep-temp', 'k', 26 ('keep-temp', 'k',
27 "keep the pseudo-installation tree around after " + 27 "keep the pseudo-installation tree around after " +
28 "creating the distribution archive"), 28 "creating the distribution archive"),
29 ('dist-dir=', 'd', 29 ('dist-dir=', 'd',
30 "directory to put final built distributions in"), 30 "directory to put final built distributions in"),
31 ('skip-build', None, 31 ('skip-build', None,
32 "skip rebuilding everything (for testing/debugging)"), 32 "skip rebuilding everything (for testing/debugging)"),
33 ('relative', None, 33 ('relative', None,
34 "build the archive using relative paths" 34 "build the archive using relative paths"
35 "(default: false)"), 35 "(default: false)"),
36 ('owner=', 'u',
37 "Owner name used when creating a tar file"
38 " [default: current user]"),
39 ('group=', 'g',
40 "Group name used when creating a tar file"
41 " [default: current group]"),
36 ] 42 ]
37 43
38 boolean_options = ['keep-temp', 'skip-build', 'relative'] 44 boolean_options = ['keep-temp', 'skip-build', 'relative']
39 45
40 default_format = { 'posix': 'gztar', 46 default_format = { 'posix': 'gztar',
41 'nt': 'zip' } 47 'nt': 'zip' }
42 48
43 def initialize_options(self): 49 def initialize_options(self):
44 self.bdist_dir = None 50 self.bdist_dir = None
45 self.plat_name = None 51 self.plat_name = None
46 self.format = None 52 self.format = None
47 self.keep_temp = 0 53 self.keep_temp = 0
48 self.dist_dir = None 54 self.dist_dir = None
49 self.skip_build = None 55 self.skip_build = None
50 self.relative = 0 56 self.relative = 0
57 self.owner = None
58 self.group = None
51 59
52 def finalize_options(self): 60 def finalize_options(self):
53 if self.bdist_dir is None: 61 if self.bdist_dir is None:
54 bdist_base = self.get_finalized_command('bdist').bdist_base 62 bdist_base = self.get_finalized_command('bdist').bdist_base
55 self.bdist_dir = os.path.join(bdist_base, 'dumb') 63 self.bdist_dir = os.path.join(bdist_base, 'dumb')
56 64
57 if self.format is None: 65 if self.format is None:
58 try: 66 try:
59 self.format = self.default_format[os.name] 67 self.format = self.default_format[os.name]
60 except KeyError: 68 except KeyError:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 "can't make a dumb built distribution where " 102 "can't make a dumb built distribution where "
95 "base and platbase are different (%s, %s)" 103 "base and platbase are different (%s, %s)"
96 % (repr(install.install_base), 104 % (repr(install.install_base),
97 repr(install.install_platbase))) 105 repr(install.install_platbase)))
98 else: 106 else:
99 archive_root = os.path.join(self.bdist_dir, 107 archive_root = os.path.join(self.bdist_dir,
100 ensure_relative(install.install_base)) 108 ensure_relative(install.install_base))
101 109
102 # Make the archive 110 # Make the archive
103 filename = self.make_archive(pseudoinstall_root, 111 filename = self.make_archive(pseudoinstall_root,
104 self.format, root_dir=archive_root) 112 self.format, root_dir=archive_root,
113 owner=self.owner, group=self.group)
105 if self.distribution.has_ext_modules(): 114 if self.distribution.has_ext_modules():
106 pyversion = get_python_version() 115 pyversion = get_python_version()
107 else: 116 else:
108 pyversion = 'any' 117 pyversion = 'any'
109 self.distribution.dist_files.append(('bdist_dumb', pyversion, 118 self.distribution.dist_files.append(('bdist_dumb', pyversion,
110 filename)) 119 filename))
111 120
112 if not self.keep_temp: 121 if not self.keep_temp:
113 remove_tree(self.bdist_dir, dry_run=self.dry_run) 122 remove_tree(self.bdist_dir, dry_run=self.dry_run)
OLDNEW
« no previous file with comments | « Lib/distutils/cmd.py ('k') | Lib/distutils/command/bdist.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+