commands: add spack resource command to inspect downloadable files

- currently just looks at patches
  - allows you to find out which package applied a patch to a spec

- intended to work with tarballs and resources in the future.

- add tab completion for `spack resource` and subcommands
This commit is contained in:
Todd Gamblin
2018-12-24 13:42:15 -08:00
parent d2db978c7f
commit d763e92141
4 changed files with 237 additions and 0 deletions

View File

@@ -1041,6 +1041,28 @@ function _spack_repo_rm {
_spack_repo_remove
}
function _spack_resource {
if $list_options
then
compgen -W "-h --help" -- "$cur"
else
compgen -W "list show" -- "$cur"
fi
}
function _spack_resource_list {
compgen -W "-h --help --only-hashes" -- "$cur"
}
function _spack_resource_show {
if $list_options
then
compgen -W "-h --help" -- "$cur"
else
compgen -W "$(_all_resource_hashes)" -- "$cur"
fi
}
function _spack_restage {
if $list_options
then
@@ -1244,6 +1266,10 @@ function _all_packages {
spack list
}
function _all_resource_hashes {
spack resource list --only-hashes
}
function _installed_packages {
spack --color=never find | grep -v "^--"
}