import os
from distutils.core import Command
-from distutils.util import get_platform, create_tree
+from distutils.util import get_platform, create_tree, remove_tree
class bdist_dumb (Command):
user_options = [('format=', 'f',
"archive format to create (tar, ztar, gztar, zip)"),
+ ('keep-tree', 'k',
+ "keep the pseudo-installation tree around after " +
+ "creating the distribution archive"),
]
default_format = { 'posix': 'gztar',
def initialize_options (self):
self.format = None
+ self.keep_tree = 0
# initialize_options()
# pseudo-installation tree.
archive_basename = "%s.%s" % (self.distribution.get_full_name(),
get_platform())
+ print "output_dir = %s" % output_dir
+ print "self.format = %s" % self.format
self.make_archive (archive_basename, self.format,
root_dir=output_dir)
+ if not self.keep_tree:
+ remove_tree (output_dir, self.verbose, self.dry_run)
+
# run()