summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2021-11-03 18:28:03 +0100
committerTodd Gamblin <tgamblin@llnl.gov>2021-11-05 00:15:47 -0700
commit31dfad9c16fd6c8cb7d6f07af449a2daf8c58f11 (patch)
tree115c7c13d53d538dbff5be0dbb40e0f1d3c5901b
parente2744fafa16749a1b2c9d8cb5bf5e1c885ba841b (diff)
downloadspack-31dfad9c16fd6c8cb7d6f07af449a2daf8c58f11.tar.gz
spack-31dfad9c16fd6c8cb7d6f07af449a2daf8c58f11.tar.bz2
spack-31dfad9c16fd6c8cb7d6f07af449a2daf8c58f11.tar.xz
spack-31dfad9c16fd6c8cb7d6f07af449a2daf8c58f11.zip
spack install: add --reuse argument
-rw-r--r--lib/spack/spack/cmd/__init__.py3
-rw-r--r--lib/spack/spack/cmd/install.py7
-rwxr-xr-xshare/spack/spack-completion.bash2
3 files changed, 7 insertions, 5 deletions
diff --git a/lib/spack/spack/cmd/__init__.py b/lib/spack/spack/cmd/__init__.py
index 501a668b7c..e5dbcd0b27 100644
--- a/lib/spack/spack/cmd/__init__.py
+++ b/lib/spack/spack/cmd/__init__.py
@@ -153,6 +153,7 @@ def parse_specs(args, **kwargs):
concretize = kwargs.get('concretize', False)
normalize = kwargs.get('normalize', False)
tests = kwargs.get('tests', False)
+ reuse = kwargs.get('reuse', False)
try:
sargs = args
@@ -161,7 +162,7 @@ def parse_specs(args, **kwargs):
specs = spack.spec.parse(sargs)
for spec in specs:
if concretize:
- spec.concretize(tests=tests) # implies normalize
+ spec.concretize(tests=tests, reuse=reuse) # implies normalize
elif normalize:
spec.normalize(tests=tests)
diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py
index 5463132878..c04fb23ea3 100644
--- a/lib/spack/spack/cmd/install.py
+++ b/lib/spack/spack/cmd/install.py
@@ -78,7 +78,7 @@ the dependencies"""
subparser.add_argument(
'-u', '--until', type=str, dest='until', default=None,
help="phase to stop after when installing (default None)")
- arguments.add_common_arguments(subparser, ['jobs'])
+ arguments.add_common_arguments(subparser, ['jobs', 'reuse'])
subparser.add_argument(
'--overwrite', action='store_true',
help="reinstall an existing spec, even if it has dependents")
@@ -338,7 +338,7 @@ environment variables:
if not args.only_concrete:
with env.write_transaction():
- concretized_specs = env.concretize(tests=tests)
+ concretized_specs = env.concretize(tests=tests, reuse=args.reuse)
ev.display_specs(concretized_specs)
# save view regeneration for later, so that we only do it
@@ -392,7 +392,8 @@ environment variables:
try:
specs = spack.cmd.parse_specs(
- args.spec, concretize=True, tests=tests)
+ args.spec, concretize=True, tests=tests, reuse=args.reuse
+ )
except SpackError as e:
tty.debug(e)
reporter.concretization_report(e.message)
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash
index 231187213c..1b9f45eae2 100755
--- a/share/spack/spack-completion.bash
+++ b/share/spack/spack-completion.bash
@@ -1176,7 +1176,7 @@ _spack_info() {
_spack_install() {
if $list_options
then
- SPACK_COMPREPLY="-h --help --only -u --until -j --jobs --overwrite --fail-fast --keep-prefix --keep-stage --dont-restage --use-cache --no-cache --cache-only --monitor --monitor-save-local --monitor-no-auth --monitor-tags --monitor-keep-going --monitor-host --monitor-prefix --include-build-deps --no-check-signature --require-full-hash-match --show-log-on-error --source -n --no-checksum --deprecated -v --verbose --fake --only-concrete --no-add -f --file --clean --dirty --test --run-tests --log-format --log-file --help-cdash --cdash-upload-url --cdash-build --cdash-site --cdash-track --cdash-buildstamp -y --yes-to-all"
+ SPACK_COMPREPLY="-h --help --only -u --until -j --jobs --reuse --overwrite --fail-fast --keep-prefix --keep-stage --dont-restage --use-cache --no-cache --cache-only --monitor --monitor-save-local --monitor-no-auth --monitor-tags --monitor-keep-going --monitor-host --monitor-prefix --include-build-deps --no-check-signature --require-full-hash-match --show-log-on-error --source -n --no-checksum --deprecated -v --verbose --fake --only-concrete --no-add -f --file --clean --dirty --test --run-tests --log-format --log-file --help-cdash --cdash-upload-url --cdash-build --cdash-site --cdash-track --cdash-buildstamp -y --yes-to-all"
else
_all_packages
fi