install: one less concretization when installing from file

This commit is contained in:
Massimiliano Culpo 2020-10-31 22:30:28 +01:00 committed by Todd Gamblin
parent 27bb970a97
commit ccb537479a

View File

@ -367,14 +367,15 @@ def install(parser, args, **kwargs):
with open(file, 'r') as f:
s = spack.spec.Spec.from_yaml(f)
if s.concretized().dag_hash() != s.dag_hash():
concretized = s.concretized()
if concretized.dag_hash() != s.dag_hash():
msg = 'skipped invalid file "{0}". '
msg += 'The file does not contain a concrete spec.'
tty.warn(msg.format(file))
continue
abstract_specs.append(s)
specs.append(s.concretized())
specs.append(concretized)
if len(specs) == 0:
tty.die('The `spack install` command requires a spec to install.')