summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-09-13 01:02:25 (GMT)
committerGreg Ward <gward@python.net>2000-09-13 01:02:25 (GMT)
commit3a0310a328384180b07547091dea5be477a06177 (patch)
tree901d77b6696900b7ecb5764cefa1d283e257af36
parent1830b2118676679813aedf211f6b967bb3fe4396 (diff)
downloadcpython-3a0310a328384180b07547091dea5be477a06177.zip
cpython-3a0310a328384180b07547091dea5be477a06177.tar.gz
cpython-3a0310a328384180b07547091dea5be477a06177.tar.bz2
Added --force (-f) option to force installation (including bytecode
compilation).
-rw-r--r--Lib/distutils/command/install.py6
-rw-r--r--Lib/distutils/command/install_data.py3
-rw-r--r--Lib/distutils/command/install_headers.py7
-rw-r--r--Lib/distutils/command/install_lib.py3
-rw-r--r--Lib/distutils/command/install_scripts.py5
5 files changed, 20 insertions, 4 deletions
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
index 2cb7871..2332770 100644
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -85,8 +85,9 @@ class install (Command):
('install-data=', None,
"installation directory for data files"),
- # For lazy debuggers who just want to test the install
- # commands without rerunning "build" all the time
+ # Miscellaneous control options
+ ('force', 'f',
+ "force installation (overwrite any existing files)"),
('skip-build', None,
"skip rebuilding everything (for testing/debugging)"),
@@ -146,6 +147,7 @@ class install (Command):
self.extra_path = None
self.install_path_file = 0
+ self.force = 0
self.skip_build = 0
# These are only here as a conduit from the 'build' command to the
diff --git a/Lib/distutils/command/install_data.py b/Lib/distutils/command/install_data.py
index 9193f91..6cfc7d4 100644
--- a/Lib/distutils/command/install_data.py
+++ b/Lib/distutils/command/install_data.py
@@ -22,18 +22,21 @@ class install_data (Command):
"(default: installation base dir)"),
('root=', None,
"install everything relative to this alternate root directory"),
+ ('force', 'f', "force installation (overwrite existing files)"),
]
def initialize_options (self):
self.install_dir = None
self.outfiles = []
self.root = None
+ self.force = 0
self.data_files = self.distribution.data_files
def finalize_options (self):
self.set_undefined_options('install',
('install_data', 'install_dir'),
('root', 'root'),
+ ('force', 'force'),
)
def run (self):
diff --git a/Lib/distutils/command/install_headers.py b/Lib/distutils/command/install_headers.py
index 2e6ce86..5c06d57 100644
--- a/Lib/distutils/command/install_headers.py
+++ b/Lib/distutils/command/install_headers.py
@@ -17,16 +17,21 @@ class install_headers (Command):
user_options = [('install-dir=', 'd',
"directory to install header files to"),
+ ('force', 'f',
+ "force installation (overwrite existing files)"),
]
def initialize_options (self):
self.install_dir = None
+ self.force = 0
self.outfiles = []
def finalize_options (self):
self.set_undefined_options('install',
- ('install_headers', 'install_dir'))
+ ('install_headers', 'install_dir'),
+ ('force', 'force'))
+
def run (self):
headers = self.distribution.headers
diff --git a/Lib/distutils/command/install_lib.py b/Lib/distutils/command/install_lib.py
index 879a7d0..2d19e5b 100644
--- a/Lib/distutils/command/install_lib.py
+++ b/Lib/distutils/command/install_lib.py
@@ -13,6 +13,7 @@ class install_lib (Command):
user_options = [
('install-dir=', 'd', "directory to install to"),
('build-dir=','b', "build directory (where to install from)"),
+ ('force', 'f', "force installation (overwrite existing files)"),
('compile', 'c', "compile .py to .pyc"),
('optimize', 'o', "compile .py to .pyo (optimized)"),
('skip-build', None, "skip the build steps"),
@@ -23,6 +24,7 @@ class install_lib (Command):
# let the 'install' command dictate our installation directory
self.install_dir = None
self.build_dir = None
+ self.force = 0
self.compile = 1
self.optimize = 1
self.skip_build = None
@@ -35,6 +37,7 @@ class install_lib (Command):
self.set_undefined_options ('install',
('build_lib', 'build_dir'),
('install_lib', 'install_dir'),
+ ('force', 'force'),
('compile_py', 'compile'),
('optimize_py', 'optimize'),
('skip_build', 'skip_build'),
diff --git a/Lib/distutils/command/install_scripts.py b/Lib/distutils/command/install_scripts.py
index 3eb3963..d506f90 100644
--- a/Lib/distutils/command/install_scripts.py
+++ b/Lib/distutils/command/install_scripts.py
@@ -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.