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.
This commit is contained in:
parent
3163d016db
commit
25f2b01a3c
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user