diff options
author | Andrew Kuchling <amk@amk.ca> | 2013-11-15 18:01:52 (GMT) |
---|---|---|
committer | Andrew Kuchling <amk@amk.ca> | 2013-11-15 18:01:52 (GMT) |
commit | 5e2d45672c8f84f6b1877e68ab92b4b50e2d124d (patch) | |
tree | acccecbfdceb5560510b1b989b44a34c65822f7d /Lib/distutils/command/bdist.py | |
parent | c31ebb60f975b231e8f2fff7af72204bf3309ed0 (diff) | |
download | cpython-5e2d45672c8f84f6b1877e68ab92b4b50e2d124d.zip cpython-5e2d45672c8f84f6b1877e68ab92b4b50e2d124d.tar.gz cpython-5e2d45672c8f84f6b1877e68ab92b4b50e2d124d.tar.bz2 |
Issue #19544 and Issue #6516: Restore support for --user and --group parameters to sdist command as found in Python 2.7 and originally slated for Python 3.2 but accidentally rolled back as part of the distutils2 rollback. Closes Issue #6516.
Diffstat (limited to 'Lib/distutils/command/bdist.py')
-rw-r--r-- | Lib/distutils/command/bdist.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/distutils/command/bdist.py b/Lib/distutils/command/bdist.py index 38b169a..6814a1c 100644 --- a/Lib/distutils/command/bdist.py +++ b/Lib/distutils/command/bdist.py @@ -37,6 +37,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'] @@ -77,6 +83,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' @@ -122,6 +130,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:]: |