mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
#6516 added owner/group support for tarfiles in Distutils
This commit is contained in:
parent
12fafe6936
commit
1b48671ef1
9 changed files with 234 additions and 20 deletions
|
@ -40,6 +40,12 @@ class bdist(Command):
|
|||
"[default: dist]"),
|
||||
('skip-build', None,
|
||||
"skip rebuilding everything (for testing/debugging)"),
|
||||
('owner=', 'u',
|
||||
"Owner name used when creating a tar file"
|
||||
" [default: current user]"),
|
||||
('group=', 'g',
|
||||
"Group name used when creating a tar file"
|
||||
" [default: current group]"),
|
||||
]
|
||||
|
||||
boolean_options = ['skip-build']
|
||||
|
@ -81,6 +87,8 @@ class bdist(Command):
|
|||
self.formats = None
|
||||
self.dist_dir = None
|
||||
self.skip_build = 0
|
||||
self.group = None
|
||||
self.owner = None
|
||||
|
||||
def finalize_options(self):
|
||||
# have to finalize 'plat_name' before 'bdist_base'
|
||||
|
@ -126,6 +134,11 @@ class bdist(Command):
|
|||
if cmd_name not in self.no_format_option:
|
||||
sub_cmd.format = self.formats[i]
|
||||
|
||||
# passing the owner and group names for tar archiving
|
||||
if cmd_name == 'bdist_dumb':
|
||||
sub_cmd.owner = self.owner
|
||||
sub_cmd.group = self.group
|
||||
|
||||
# If we're going to need to run this command again, tell it to
|
||||
# keep its temporary files around so subsequent runs go faster.
|
||||
if cmd_name in commands[i+1:]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue