mirror of
https://github.com/python/cpython.git
synced 2025-10-02 21:25:24 +00:00
Added --force (-f) option to force installation (including bytecode
compilation).
This commit is contained in:
parent
1830b21186
commit
3a0310a328
5 changed files with 20 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -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,6 +32,7 @@ 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'),
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue