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:
		| @@ -33,10 +33,13 @@ def setup_parser(subparser): | |||||||
|     subparser.add_argument( |     subparser.add_argument( | ||||||
|         '-n', '--no-checksum', action='store_true', dest='no_checksum', |         '-n', '--no-checksum', action='store_true', dest='no_checksum', | ||||||
|         help="Do not check packages against 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( |     subparser.add_argument( | ||||||
|         'packages', nargs=argparse.REMAINDER, help="specs of packages to fetch") |         'packages', nargs=argparse.REMAINDER, help="specs of packages to fetch") | ||||||
|  |  | ||||||
|  |  | ||||||
| def fetch(parser, args): | def fetch(parser, args): | ||||||
|     if not args.packages: |     if not args.packages: | ||||||
|         tty.die("fetch requires at least one package argument") |         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) |     specs = spack.cmd.parse_specs(args.packages, concretize=True) | ||||||
|     for spec in specs: |     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 = spack.db.get(spec) | ||||||
|         package.do_fetch() |         package.do_fetch() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Tom Scogland
					Tom Scogland