From 25f2b01a3cbf74fa86f349287e8026ea422fbeb3 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Thu, 10 Dec 2015 07:27:06 -0800 Subject: fetch: add options to fetch missing or all deps Small additions to fetch to make it easier to fetch all files necessary for a build on a system without network connectivity. --- lib/spack/spack/cmd/fetch.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/spack/spack/cmd/fetch.py b/lib/spack/spack/cmd/fetch.py index 6f9e7ab5e2..04cad80bd2 100644 --- a/lib/spack/spack/cmd/fetch.py +++ b/lib/spack/spack/cmd/fetch.py @@ -33,10 +33,13 @@ def setup_parser(subparser): subparser.add_argument( '-n', '--no-checksum', action='store_true', dest='no_checksum', help="Do not check packages against checksum") + subparser.add_argument( + '-m', '--missing', action='store_true', help="Also fetch all missing dependencies") + subparser.add_argument( + '-d', '--dependencies', action='store_true', help="Also fetch all dependencies") subparser.add_argument( 'packages', nargs=argparse.REMAINDER, help="specs of packages to fetch") - def fetch(parser, args): if not args.packages: tty.die("fetch requires at least one package argument") @@ -46,5 +49,13 @@ def fetch(parser, args): specs = spack.cmd.parse_specs(args.packages, concretize=True) for spec in specs: + if args.missing or args.dependencies: + to_fetch = set() + for s in spec.traverse(): + package = spack.db.get(s) + if args.missing and package.installed: + continue + package.do_fetch() + package = spack.db.get(spec) package.do_fetch() -- cgit v1.2.3-70-g09d2