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:
		| @@ -172,6 +172,7 @@ def setup_parser(sp): | |||||||
| def view(parser, args): | def view(parser, args): | ||||||
|     'Produce a view of a set of packages.' |     'Produce a view of a set of packages.' | ||||||
|  |  | ||||||
|  |     specs = spack.cmd.parse_specs(args.specs) | ||||||
|     path = args.path[0] |     path = args.path[0] | ||||||
|  |  | ||||||
|     view = YamlFilesystemView( |     view = YamlFilesystemView( | ||||||
| @@ -189,18 +190,18 @@ def view(parser, args): | |||||||
|  |  | ||||||
|     elif args.action in actions_link: |     elif args.action in actions_link: | ||||||
|         # only link commands need to disambiguate specs |         # 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: |     elif args.action in actions_status: | ||||||
|         # no specs implies all |         # no specs implies all | ||||||
|         if len(args.specs) == 0: |         if len(specs) == 0: | ||||||
|             specs = view.get_all_specs() |             specs = view.get_all_specs() | ||||||
|         else: |         else: | ||||||
|             specs = relaxed_disambiguate(args.specs, view) |             specs = relaxed_disambiguate(specs, view) | ||||||
|  |  | ||||||
|     else: |     else: | ||||||
|         # status and remove can map the name to packages in view |         # 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'] |     with_dependencies = args.dependencies.lower() in ['true', 'yes'] | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 healther
					healther