Skip to content
Snippets Groups Projects
Commit 63f824b2 authored by Tom Scogland's avatar Tom Scogland
Browse files

add a path argument to the stage command

Allow users to use spack to stage a, potentially complex, package into a
given path.  This is nice for packages with multiple resources that must
be placed, for example LLVM with all sub-projects.
parent 0840ffa3
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,9 @@ def setup_parser(subparser):
subparser.add_argument(
'-n', '--no-checksum', action='store_true', dest='no_checksum',
help="Do not check downloaded packages against checksum")
subparser.add_argument(
'-p', '--path', dest='path',
help="Path to stage package, does not add to spack tree")
subparser.add_argument(
'specs', nargs=argparse.REMAINDER, help="specs of packages to stage")
......@@ -50,4 +53,7 @@ def stage(parser, args):
specs = spack.cmd.parse_specs(args.specs, concretize=True)
for spec in specs:
package = spack.repo.get(spec)
package.do_stage()
if args.path:
package.do_stage(path=args.path)
else:
package.do_stage()
......@@ -709,14 +709,18 @@ def do_fetch(self, mirror_only=False):
if spack.do_checksum and self.version in self.versions:
self.stage.check()
def do_stage(self, mirror_only=False):
def do_stage(self, mirror_only=False, path=None):
"""Unpacks the fetched tarball, then changes into the expanded tarball
directory."""
if not self.spec.concrete:
raise ValueError("Can only stage concrete packages.")
self.do_fetch(mirror_only)
if path is not None:
self.stage.path = path
self.stage.expand_archive()
self.stage.chdir_to_source()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment