summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPeter Scheibel <scheibel1@llnl.gov>2015-10-15 19:38:47 -0700
committerPeter Scheibel <scheibel1@llnl.gov>2015-10-15 19:38:47 -0700
commit82ed1bc34397542394ea7fc4a23f3b827546809a (patch)
treee5b7d058c6350453b9456f4276502ed03fc24a04 /lib
parente451421db32b5e2059d9da293c70baa4b3374449 (diff)
downloadspack-82ed1bc34397542394ea7fc4a23f3b827546809a.tar.gz
spack-82ed1bc34397542394ea7fc4a23f3b827546809a.tar.bz2
spack-82ed1bc34397542394ea7fc4a23f3b827546809a.tar.xz
spack-82ed1bc34397542394ea7fc4a23f3b827546809a.zip
Originally I enforced specifying 1 top-level package with the test-install
command by having it consume exactly 1 positional argument (i.e. by removing "nargs=argparse.REMAINDER") but this does not work when configuring dependencies of a top-level package (which show up as additional positional args). Instead now there is an explicit check to ensure there is only 1 top-level package.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/test-install.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/spack/spack/cmd/test-install.py b/lib/spack/spack/cmd/test-install.py
index e207295810..962af939f2 100644
--- a/lib/spack/spack/cmd/test-install.py
+++ b/lib/spack/spack/cmd/test-install.py
@@ -49,7 +49,7 @@ def setup_parser(subparser):
'-o', '--output', action='store', help="test output goes in this file")
subparser.add_argument(
- 'package', help="spec of package to install")
+ 'package', nargs=argparse.REMAINDER, help="spec of package to install")
class JunitResultFormat(object):
@@ -120,11 +120,10 @@ def test_install(parser, args):
if args.no_checksum:
spack.do_checksum = False # TODO: remove this global.
-
- # TODO: should a single argument be wrapped in a list?
- specs = spack.cmd.parse_specs(args.package, concretize=True)
- # There is 1 top-level package
+ specs = spack.cmd.parse_specs(args.package, concretize=True)
+ if len(specs) > 1:
+ tty.die("Only 1 top-level package can be specified")
topSpec = iter(specs).next()
newInstalls = set()