summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2018-10-14 16:49:40 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2018-11-09 00:31:24 -0800
commit3fd9fc89941a6bd247d125c07f34f16f3ac58429 (patch)
tree1dc9dc0b89b7c196477707e1fa818b2a71fdb244
parentd14f7b82bb0435053a94ae26fd597767d151f8a9 (diff)
downloadspack-3fd9fc89941a6bd247d125c07f34f16f3ac58429.tar.gz
spack-3fd9fc89941a6bd247d125c07f34f16f3ac58429.tar.bz2
spack-3fd9fc89941a6bd247d125c07f34f16f3ac58429.tar.xz
spack-3fd9fc89941a6bd247d125c07f34f16f3ac58429.zip
env: `spack env install` automatically concretizes specs
-rw-r--r--lib/spack/spack/cmd/env.py12
-rw-r--r--lib/spack/spack/environment.py10
2 files changed, 16 insertions, 6 deletions
diff --git a/lib/spack/spack/cmd/env.py b/lib/spack/spack/cmd/env.py
index 265139a09f..df26e9ece7 100644
--- a/lib/spack/spack/cmd/env.py
+++ b/lib/spack/spack/cmd/env.py
@@ -353,14 +353,24 @@ def _env_concretize(env, use_repo=False, force=False):
# env install
#
def env_install_setup_parser(subparser):
- """install all concretized specs in an environment"""
+ """concretize and install all specs in an environment"""
subparser.add_argument(
'env', nargs='?', help='install all packages in this environment')
+ subparser.add_argument(
+ '--only-concrete', action='store_true', default=False,
+ help='only install already concretized specs')
spack.cmd.install.add_common_arguments(subparser)
def env_install(args):
env = get_env(args, 'status')
+
+ # concretize unless otherwise specified
+ if not args.only_concrete:
+ env.concretize()
+ env.write()
+
+ # install all specs in the environment
env.install(args)
diff --git a/lib/spack/spack/environment.py b/lib/spack/spack/environment.py
index ab4d464d4c..fd21ece9e1 100644
--- a/lib/spack/spack/environment.py
+++ b/lib/spack/spack/environment.py
@@ -425,9 +425,8 @@ class Environment(object):
# return only the newly concretized specs
return new_specs
- def install(self, install_args=None):
- """Do a `spack install` on all the (concretized)
- specs in an Environment."""
+ def install(self, args=None):
+ """Install all concretized specs in an environment."""
# Make sure log directory exists
logs_dir = log_path(self.dotenv_path)
@@ -439,8 +438,9 @@ class Environment(object):
# Parse cli arguments and construct a dictionary
# that will be passed to Package.do_install API
kwargs = dict()
- if install_args:
- spack.cmd.install.update_kwargs_from_args(install_args, kwargs)
+ if args:
+ spack.cmd.install.update_kwargs_from_args(args, kwargs)
+
with fs.working_dir(self.path):
spec.package.do_install(**kwargs)