summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Scogland <scogland1@llnl.gov>2015-12-10 08:32:51 -0800
committerTom Scogland <scogland1@llnl.gov>2015-12-10 08:32:51 -0800
commit786f4cd2c2cc492f25f8886223efaa397ac97185 (patch)
tree05955190c15c71f2f7c0ddbaa2577fe548f46454 /lib
parent25f2b01a3cbf74fa86f349287e8026ea422fbeb3 (diff)
downloadspack-786f4cd2c2cc492f25f8886223efaa397ac97185.tar.gz
spack-786f4cd2c2cc492f25f8886223efaa397ac97185.tar.bz2
spack-786f4cd2c2cc492f25f8886223efaa397ac97185.tar.xz
spack-786f4cd2c2cc492f25f8886223efaa397ac97185.zip
add dependency fetching to mirror creation
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/fetch.py2
-rw-r--r--lib/spack/spack/cmd/mirror.py11
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/spack/spack/cmd/fetch.py b/lib/spack/spack/cmd/fetch.py
index 04cad80bd2..57d6f6b63b 100644
--- a/lib/spack/spack/cmd/fetch.py
+++ b/lib/spack/spack/cmd/fetch.py
@@ -36,7 +36,7 @@ def setup_parser(subparser):
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")
+ '-D', '--dependencies', action='store_true', help="Also fetch all dependencies")
subparser.add_argument(
'packages', nargs=argparse.REMAINDER, help="specs of packages to fetch")
diff --git a/lib/spack/spack/cmd/mirror.py b/lib/spack/spack/cmd/mirror.py
index 4a1ce00b75..10348e5b99 100644
--- a/lib/spack/spack/cmd/mirror.py
+++ b/lib/spack/spack/cmd/mirror.py
@@ -55,6 +55,8 @@ def setup_parser(subparser):
create_parser.add_argument(
'-f', '--file', help="File with specs of packages to put in mirror.")
create_parser.add_argument(
+ '-D', '--dependencies', action='store_true', help="Also fetch all dependencies")
+ create_parser.add_argument(
'-o', '--one-version-per-spec', action='store_const', const=1, default=0,
help="Only fetch one 'preferred' version per spec, not all known versions.")
@@ -118,7 +120,7 @@ def mirror_create(args):
"""Create a directory to be used as a spack mirror, and fill it with
package archives."""
# try to parse specs from the command line first.
- specs = spack.cmd.parse_specs(args.specs)
+ specs = spack.cmd.parse_specs(args.specs, concretize=True)
# If there is a file, parse each line as a spec and add it to the list.
if args.file:
@@ -131,6 +133,13 @@ def mirror_create(args):
specs = [Spec(n) for n in spack.db.all_package_names()]
specs.sort(key=lambda s: s.format("$_$@").lower())
+ if args.dependencies:
+ new_specs = set()
+ for spec in specs:
+ for s in spec.traverse():
+ new_specs.add(s)
+ specs = list(new_specs)
+
# Default name for directory is spack-mirror-<DATESTAMP>
directory = args.directory
if not directory: