diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/cmd/stage.py | 8 | ||||
-rw-r--r-- | lib/spack/spack/package.py | 8 |
2 files changed, 13 insertions, 3 deletions
diff --git a/lib/spack/spack/cmd/stage.py b/lib/spack/spack/cmd/stage.py index 5786780efb..749fa90868 100644 --- a/lib/spack/spack/cmd/stage.py +++ b/lib/spack/spack/cmd/stage.py @@ -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() diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 9af3221837..ce314b7b0a 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -709,14 +709,18 @@ class Package(object): 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() |