Skip to content
Snippets Groups Projects
Commit 2374eb4d authored by Todd Gamblin's avatar Todd Gamblin
Browse files

Fix for SPACK-62

- deactivate -a errors if arg is not activated
- deactivate -af does not.
parent 2eda01c7
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@ def setup_parser(subparser):
def activate(parser, args):
# TODO: shouldn't have to concretize here. Fix DAG issues.
specs = spack.cmd.parse_specs(args.spec, concretize=True)
if len(specs) != 1:
tty.die("activate requires one spec. %d given." % len(specs))
......@@ -47,6 +48,7 @@ def activate(parser, args):
spack.db.get(specs[0])
spec = spack.cmd.disambiguate_spec(specs[0])
if not spec.package.is_extension:
tty.die("%s is not an extension." % spec.name)
......
......@@ -44,6 +44,7 @@ def setup_parser(subparser):
def deactivate(parser, args):
# TODO: shouldn't have to concretize here. Fix DAG issues.
specs = spack.cmd.parse_specs(args.spec, concretize=True)
if len(specs) != 1:
tty.die("deactivate requires one spec. %d given." % len(specs))
......@@ -59,6 +60,7 @@ def deactivate(parser, args):
if pkg.extendable:
tty.msg("Deactivating all extensions of %s" % pkg.spec.short_spec)
ext_pkgs = spack.db.installed_extensions_for(spec)
for ext_pkg in ext_pkgs:
ext_pkg.spec.normalize()
if ext_pkg.activated:
......@@ -68,6 +70,9 @@ def deactivate(parser, args):
# TODO: store DAG info properly (see above)
spec.normalize()
if not args.force and not spec.package.activated:
tty.die("%s is not activated." % pkg.spec.short_spec)
tty.msg("Deactivating %s and all dependencies." % pkg.spec.short_spec)
topo_order = topological_sort(spec)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment