summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-07-05 03:06:46 (GMT)
committerGreg Ward <gward@python.net>2000-07-05 03:06:46 (GMT)
commitc0614105aa0c57692da2d3a7354a5df4704ad70f (patch)
tree6884b0191ff1a0cce264fb7eca7f717d885c493e
parentb5316188ee5f197b5a15db6671718839170be409 (diff)
downloadcpython-c0614105aa0c57692da2d3a7354a5df4704ad70f.zip
cpython-c0614105aa0c57692da2d3a7354a5df4704ad70f.tar.gz
cpython-c0614105aa0c57692da2d3a7354a5df4704ad70f.tar.bz2
Added the --dist-dir option to control where the archive(s) are put;
defaults to 'dist' (ie. no longer in the distribution root).
-rw-r--r--Lib/distutils/command/sdist.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py
index 6f867e8..2d31640 100644
--- a/Lib/distutils/command/sdist.py
+++ b/Lib/distutils/command/sdist.py
@@ -64,6 +64,9 @@ class sdist (Command):
('keep-tree', 'k',
"keep the distribution tree around after creating " +
"archive file(s)"),
+ ('dist-dir=', 'd',
+ "directory to put the source distribution archive(s) in "
+ "[default: dist]"),
]
@@ -94,6 +97,7 @@ class sdist (Command):
self.formats = None
self.keep_tree = 0
+ self.dist_dir = None
self.archive_files = None
@@ -118,6 +122,9 @@ class sdist (Command):
raise DistutilsOptionError, \
"unknown archive format '%s'" % bad_format
+ if self.dist_dir is None:
+ self.dist_dir = "dist"
+
def run (self):
@@ -667,11 +674,14 @@ class sdist (Command):
# Don't warn about missing meta-data here -- should be (and is!)
# done elsewhere.
base_dir = self.distribution.get_fullname()
+ base_name = os.path.join(self.dist_dir, base_dir)
self.make_release_tree (base_dir, self.files)
archive_files = [] # remember names of files we create
+ if self.dist_dir:
+ self.mkpath(self.dist_dir)
for fmt in self.formats:
- file = self.make_archive (base_dir, fmt, base_dir=base_dir)
+ file = self.make_archive (base_name, fmt, base_dir=base_dir)
archive_files.append(file)
self.archive_files = archive_files