summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2017-12-19 03:50:02 +0100
committerscheibelp <scheibel1@llnl.gov>2017-12-18 18:50:02 -0800
commit01924558850ff5b54c9d22066b40eccb878c80f1 (patch)
tree579207d1eafff2fcc0da6d8552923c03844fc9fc
parent36fa57477958820301845f04cc71f1dbd8d29327 (diff)
downloadspack-01924558850ff5b54c9d22066b40eccb878c80f1.tar.gz
spack-01924558850ff5b54c9d22066b40eccb878c80f1.tar.bz2
spack-01924558850ff5b54c9d22066b40eccb878c80f1.tar.xz
spack-01924558850ff5b54c9d22066b40eccb878c80f1.zip
spack install: make restaging the default (#6465)
Fixes #5940 This PR changes the option '--restage' of 'spack install' to '--dont-restage', inverting its meaning and the default behavior of the command.
-rw-r--r--lib/spack/spack/cmd/install.py6
-rw-r--r--lib/spack/spack/package.py6
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py
index 86acd580d7..e4fb008172 100644
--- a/lib/spack/spack/cmd/install.py
+++ b/lib/spack/spack/cmd/install.py
@@ -71,8 +71,8 @@ the dependencies"""
'--keep-stage', action='store_true',
help="don't remove the build stage if installation succeeds")
subparser.add_argument(
- '--restage', action='store_true',
- help="if a partial install is detected, delete prior state")
+ '--dont-restage', action='store_true',
+ help="if a partial install is detected, don't delete prior state")
subparser.add_argument(
'--use-cache', action='store_true', dest='use_cache',
help="check for pre-built Spack packages in mirrors")
@@ -392,7 +392,7 @@ def install(parser, args, **kwargs):
kwargs.update({
'keep_prefix': args.keep_prefix,
'keep_stage': args.keep_stage,
- 'restage': args.restage,
+ 'restage': not args.dont_restage,
'install_source': args.install_source,
'install_deps': 'dependencies' in args.things_to_install,
'make_jobs': args.jobs,
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 712f252494..969daa469c 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -1343,6 +1343,12 @@ class PackageBase(with_metaclass(PackageMeta, object)):
msg = '{0.name} is already installed in {0.prefix}'
tty.msg(msg.format(self))
rec = spack.store.db.get_record(self.spec)
+ # In case the stage directory has already been created,
+ # this ensures it's removed after we checked that the spec
+ # is installed
+ if keep_stage is False:
+ self.stage.destroy()
+
return self._update_explicit_entry_in_db(rec, explicit)
self._do_install_pop_kwargs(kwargs)