make view understand hashes (#7573)
Fixes #7548 This updates the "spack view" command to use the same parsing logic as "spack install" on the user-provided specs. For example you can provide a DAG hash to refer to an exact installed spec instead of specifying name, compiler, etc.
This commit is contained in:
parent
3f14212ded
commit
6a0f9ccf82
@ -172,6 +172,7 @@ def setup_parser(sp):
|
||||
def view(parser, args):
|
||||
'Produce a view of a set of packages.'
|
||||
|
||||
specs = spack.cmd.parse_specs(args.specs)
|
||||
path = args.path[0]
|
||||
|
||||
view = YamlFilesystemView(
|
||||
@ -189,18 +190,18 @@ def view(parser, args):
|
||||
|
||||
elif args.action in actions_link:
|
||||
# only link commands need to disambiguate specs
|
||||
specs = [spack.cmd.disambiguate_spec(s) for s in args.specs]
|
||||
specs = [spack.cmd.disambiguate_spec(s) for s in specs]
|
||||
|
||||
elif args.action in actions_status:
|
||||
# no specs implies all
|
||||
if len(args.specs) == 0:
|
||||
if len(specs) == 0:
|
||||
specs = view.get_all_specs()
|
||||
else:
|
||||
specs = relaxed_disambiguate(args.specs, view)
|
||||
specs = relaxed_disambiguate(specs, view)
|
||||
|
||||
else:
|
||||
# status and remove can map the name to packages in view
|
||||
specs = relaxed_disambiguate(args.specs, view)
|
||||
specs = relaxed_disambiguate(specs, view)
|
||||
|
||||
with_dependencies = args.dependencies.lower() in ['true', 'yes']
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user