Override partial installs by default (#3530)

* Package install remove prior unfinished installs

Depending on how spack is terminated in the middle of building a
package it may leave a partially installed package in the install
prefix. Originally Spack treated the package as being installed if
the prefix was present, in which case the user would have to
manually remove the installation prefix before restarting an
install. This commit adds a more thorough check to ensure that a
package is actually installed. If the installation prefix is present
but Spack determines that the install did not complete, it removes
the installation prefix and starts a new install; if the user has
enabled --keep-prefix, then Spack reverts to its old behavior.

* Added test for partial install handling

* Added test for restoring DB

* Style fixes

* Restoring 2.6 compatibility

* Relocated repair logic to separate function

* If --keep-prefix is set, package installs will continue an install from an existing prefix if one is present

* check metadata consistency when continuing partial install

* Added --force option to make spack reinstall a package (and all dependencies) from scratch

* Updated bash completion; removed '-f' shorthand for '--force' for install command

* dont use multiple write modes for completion file
This commit is contained in:
scheibelp
2017-04-19 21:59:18 -07:00
committed by Todd Gamblin
parent e12f2c1855
commit a65c37f15d
6 changed files with 245 additions and 8 deletions

View File

@@ -407,7 +407,7 @@ function _spack_install {
then
compgen -W "-h --help --only -j --jobs --keep-prefix --keep-stage
-n --no-checksum -v --verbose --fake --clean --dirty
--run-tests --log-format --log-file" -- "$cur"
--run-tests --log-format --log-file --force" -- "$cur"
else
compgen -W "$(_all_packages)" -- "$cur"
fi