summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-10-02 23:56:02 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-10-02 23:56:02 (GMT)
commit05b303443bd522134401164f3bd6b1b5d30c9f51 (patch)
tree422a52c1796e2b61a73391701ac88358191ece2b /Lib/distutils/command
parent574b1d6a60ed88af366a55aa1d19abf2425ec0c5 (diff)
downloadcpython-05b303443bd522134401164f3bd6b1b5d30c9f51.zip
cpython-05b303443bd522134401164f3bd6b1b5d30c9f51.tar.gz
cpython-05b303443bd522134401164f3bd6b1b5d30c9f51.tar.bz2
Merged revisions 75192 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r75192 | tarek.ziade | 2009-10-03 01:49:48 +0200 (Sat, 03 Oct 2009) | 1 line #6516 added owner/group support for tarfiles in Distutils ........
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r--Lib/distutils/command/bdist.py13
-rw-r--r--Lib/distutils/command/bdist_dumb.py11
-rw-r--r--Lib/distutils/command/sdist.py9
3 files changed, 31 insertions, 2 deletions
diff --git a/Lib/distutils/command/bdist.py b/Lib/distutils/command/bdist.py
index 1a360b5..2c81f3a 100644
--- a/Lib/distutils/command/bdist.py
+++ b/Lib/distutils/command/bdist.py
@@ -39,6 +39,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']
@@ -80,6 +86,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'
@@ -125,6 +133,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:]:
diff --git a/Lib/distutils/command/bdist_dumb.py b/Lib/distutils/command/bdist_dumb.py
index 63c0a47..49fd653 100644
--- a/Lib/distutils/command/bdist_dumb.py
+++ b/Lib/distutils/command/bdist_dumb.py
@@ -36,6 +36,12 @@ class bdist_dumb(Command):
('relative', None,
"build the archive using relative paths"
"(default: false)"),
+ ('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 = ['keep-temp', 'skip-build', 'relative']
@@ -52,6 +58,8 @@ class bdist_dumb(Command):
self.dist_dir = None
self.skip_build = 0
self.relative = 0
+ self.owner = None
+ self.group = None
def finalize_options(self):
if self.bdist_dir is None:
@@ -109,7 +117,8 @@ class bdist_dumb(Command):
# Make the archive
filename = self.make_archive(pseudoinstall_root,
- self.format, root_dir=archive_root)
+ self.format, root_dir=archive_root,
+ owner=self.owner, group=self.group)
if self.distribution.has_ext_modules():
pyversion = get_python_version()
else:
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py
index ace9eee..76e1de8 100644
--- a/Lib/distutils/command/sdist.py
+++ b/Lib/distutils/command/sdist.py
@@ -75,6 +75,10 @@ class sdist(Command):
('medata-check', None,
"Ensure that all required elements of meta-data "
"are supplied. Warn if any missing. [default]"),
+ ('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 = ['use-defaults', 'prune',
@@ -114,6 +118,8 @@ class sdist(Command):
self.archive_files = None
self.metadata_check = 1
+ self.owner = None
+ self.group = None
def finalize_options(self):
if self.manifest is None:
@@ -449,7 +455,8 @@ class sdist(Command):
self.formats.append(self.formats.pop(self.formats.index('tar')))
for fmt in self.formats:
- file = self.make_archive(base_name, fmt, base_dir=base_dir)
+ file = self.make_archive(base_name, fmt, base_dir=base_dir,
+ owner=self.owner, group=self.group)
archive_files.append(file)
self.distribution.dist_files.append(('sdist', '', file))