summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthias Wolf <m+git@sushinara.net>2019-01-11 22:57:11 +0100
committerTodd Gamblin <tgamblin@llnl.gov>2019-01-11 13:57:10 -0800
commit3c6d484150a8e13431caa6801921bf8fd3e5fc71 (patch)
treeeffe3703f75d35055178705f0b0d2f13885cd9d6 /lib
parentf9967d2f6f9d5c9c295eeacaee75c25c5c7f5677 (diff)
downloadspack-3c6d484150a8e13431caa6801921bf8fd3e5fc71.tar.gz
spack-3c6d484150a8e13431caa6801921bf8fd3e5fc71.tar.bz2
spack-3c6d484150a8e13431caa6801921bf8fd3e5fc71.tar.xz
spack-3c6d484150a8e13431caa6801921bf8fd3e5fc71.zip
enh: `buildcache list` should behave similar to `find` (#10052)
The current output of buildcache list is very verbose and I feel like some details are getting lost. By making the output similar to find, I think users will be able to get a better overview of what is stored in the cache.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/buildcache.py25
1 files changed, 10 insertions, 15 deletions
diff --git a/lib/spack/spack/cmd/buildcache.py b/lib/spack/spack/cmd/buildcache.py
index 1a45849cff..5e8c211b70 100644
--- a/lib/spack/spack/cmd/buildcache.py
+++ b/lib/spack/spack/cmd/buildcache.py
@@ -13,6 +13,8 @@ import spack.repo
import spack.store
import spack.spec
import spack.binary_distribution as bindist
+import spack.cmd.common.arguments as arguments
+from spack.cmd import display_specs
description = "create, download and install binary packages"
section = "packaging"
@@ -63,6 +65,11 @@ def setup_parser(subparser):
install.set_defaults(func=installtarball)
listcache = subparsers.add_parser('list', help=listspecs.__doc__)
+ arguments.add_common_arguments(listcache, ['long', 'very_long'])
+ listcache.add_argument('-v', '--variants',
+ action='store_true',
+ dest='variants',
+ help='show variants in output (can be long)')
listcache.add_argument('-f', '--force', action='store_true',
help="force new download of specs")
listcache.add_argument(
@@ -254,22 +261,10 @@ def listspecs(args):
specs = bindist.get_specs(args.force)
if args.packages:
pkgs = set(args.packages)
- for pkg in pkgs:
- tty.msg("buildcache spec(s) matching " +
- "%s and commands to install them" % pkgs)
- for spec in sorted(specs):
- if spec.satisfies(pkg):
- tty.msg('Enter\nspack buildcache install /%s\n' %
- spec.dag_hash(7) +
- ' to install "%s"' %
- spec.format())
+ specs = [s for s in specs for p in pkgs if s.satisfies(p)]
+ display_specs(specs, args, all_headers=True)
else:
- tty.msg("buildcache specs and commands to install them")
- for spec in sorted(specs):
- tty.msg('Enter\nspack buildcache install /%s\n' %
- spec.dag_hash(7) +
- ' to install "%s"' %
- spec.format())
+ display_specs(specs, args, all_headers=True)
def getkeys(args):