summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Scogland <scogland1@llnl.gov>2015-12-10 07:27:06 -0800
committerTom Scogland <scogland1@llnl.gov>2015-12-10 07:27:06 -0800
commit25f2b01a3cbf74fa86f349287e8026ea422fbeb3 (patch)
treef2ddcdaea354269173741bcac83defe679f2d331 /lib
parent3163d016db3849c3c9e801c1cdb9e6e907afa313 (diff)
downloadspack-25f2b01a3cbf74fa86f349287e8026ea422fbeb3.tar.gz
spack-25f2b01a3cbf74fa86f349287e8026ea422fbeb3.tar.bz2
spack-25f2b01a3cbf74fa86f349287e8026ea422fbeb3.tar.xz
spack-25f2b01a3cbf74fa86f349287e8026ea422fbeb3.zip
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/fetch.py13
1 files changed, 12 insertions, 1 deletions
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
@@ -34,9 +34,12 @@ def setup_parser(subparser):
'-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()