From a65c37f15dff4b4d60784fd4fcc55874ce9d6d11 Mon Sep 17 00:00:00 2001 From: scheibelp Date: Wed, 19 Apr 2017 21:59:18 -0700 Subject: 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 --- share/spack/spack-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index 819dcc06ab..1167690fa2 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -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 -- cgit v1.2.3-70-g09d2