Added --force (-f) option to force installation (including bytecode

compilation).
This commit is contained in:
Greg Ward 2000-09-13 01:02:25 +00:00
parent 1830b21186
commit 3a0310a328
5 changed files with 20 additions and 4 deletions

View file

@ -18,11 +18,13 @@ class install_scripts (Command):
user_options = [
('install-dir=', 'd', "directory to install scripts to"),
('build-dir=','b', "build directory (where to install from)"),
('force', 'f', "force installation (overwrite existing files)"),
('skip-build', None, "skip the build steps"),
]
def initialize_options (self):
self.install_dir = None
self.force = 0
self.build_dir = None
self.skip_build = None
@ -30,13 +32,14 @@ class install_scripts (Command):
self.set_undefined_options('build', ('build_scripts', 'build_dir'))
self.set_undefined_options ('install',
('install_scripts', 'install_dir'),
('force', 'force'),
('skip_build', 'skip_build'),
)
def run (self):
if not self.skip_build:
self.run_command('build_scripts')
self.outfiles = self.copy_tree (self.build_dir, self.install_dir)
self.outfiles = self.copy_tree(self.build_dir, self.install_dir)
if os.name == 'posix':
# Set the executable bits (owner, group, and world) on
# all the scripts we just installed.