summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-06-01 01:07:55 (GMT)
committerGreg Ward <gward@python.net>2000-06-01 01:07:55 (GMT)
commit879096137d95548dacc8ce88d11d8e23fe239f09 (patch)
tree8f4ad9090585361ee69f6d7a2770a2fe2045a98a
parent01a4694dce866bfa1162e6a918be6cfbe916559d (diff)
downloadcpython-879096137d95548dacc8ce88d11d8e23fe239f09.zip
cpython-879096137d95548dacc8ce88d11d8e23fe239f09.tar.gz
cpython-879096137d95548dacc8ce88d11d8e23fe239f09.tar.bz2
Ensure that 'make_archive()' returns the name of the new archive file.
-rw-r--r--Lib/distutils/archive_util.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/distutils/archive_util.py b/Lib/distutils/archive_util.py
index 218450a..3159c28 100644
--- a/Lib/distutils/archive_util.py
+++ b/Lib/distutils/archive_util.py
@@ -127,7 +127,6 @@ def check_archive_formats (formats):
def make_archive (base_name, format,
root_dir=None, base_dir=None,
verbose=0, dry_run=0):
-
"""Create an archive file (eg. zip or tar). 'base_name' is the name
of the file to create, minus any format-specific extension; 'format'
is the archive format: one of "zip", "tar", "ztar", or "gztar".
@@ -136,8 +135,8 @@ def make_archive (base_name, format,
archive. 'base_dir' is the directory where we start archiving from;
ie. 'base_dir' will be the common prefix of all files and
directories in the archive. 'root_dir' and 'base_dir' both default
- to the current directory."""
-
+ to the current directory. Returns the name of the archive file.
+ """
save_cwd = os.getcwd()
if root_dir is not None:
if verbose:
@@ -160,11 +159,13 @@ def make_archive (base_name, format,
func = format_info[0]
for (arg,val) in format_info[1]:
kwargs[arg] = val
- apply (func, (base_name, base_dir), kwargs)
+ filename = apply (func, (base_name, base_dir), kwargs)
if root_dir is not None:
if verbose:
print "changing back to '%s'" % save_cwd
os.chdir (save_cwd)
+ return filename
+
# make_archive ()