"""distutils.command.install_scripts
Implements the Distutils 'install_scripts' command, for installing
# contributed by Bastian Kleineidam
# This module should be kept compatible with Python 2.1.
__revision__
= "$Id: install_scripts.py,v 1.16 2004/11/10 22:23:15 loewis Exp $"
from distutils
.core
import Command
from distutils
import log
class install_scripts (Command
):
description
= "install scripts (Python or otherwise)"
('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"),
boolean_options
= ['force', 'skip-build']
def initialize_options (self
):
def finalize_options (self
):
self
.set_undefined_options('build', ('build_scripts', 'build_dir'))
self
.set_undefined_options('install',
('install_scripts', 'install_dir'),
('skip_build', 'skip_build'),
self
.run_command('build_scripts')
self
.outfiles
= self
.copy_tree(self
.build_dir
, self
.install_dir
)
# Set the executable bits (owner, group, and world) on
# all the scripts we just installed.
for file in self
.get_outputs():
log
.info("changing mode of %s", file)
mode
= ((os
.stat(file)[ST_MODE
]) |
0555) & 07777
log
.info("changing mode of %s to %o", file, mode
)
return self
.distribution
.scripts
or []
return self
.outfiles
or []