diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2015-02-18 16:45:12 -0800 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2015-02-18 16:45:12 -0800 |
commit | 2374eb4dca2a3bb4db5586251964d5ca9166b45a (patch) | |
tree | 4b1f3b659cc25921b66d8e377e1465d749d13193 /lib | |
parent | 2eda01c703cbd1692130ffc8ed48a9163fda87b6 (diff) | |
download | spack-2374eb4dca2a3bb4db5586251964d5ca9166b45a.tar.gz spack-2374eb4dca2a3bb4db5586251964d5ca9166b45a.tar.bz2 spack-2374eb4dca2a3bb4db5586251964d5ca9166b45a.tar.xz spack-2374eb4dca2a3bb4db5586251964d5ca9166b45a.zip |
Fix for SPACK-62
- deactivate -a errors if arg is not activated
- deactivate -af does not.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/cmd/activate.py | 2 | ||||
-rw-r--r-- | lib/spack/spack/cmd/deactivate.py | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/spack/spack/cmd/activate.py b/lib/spack/spack/cmd/activate.py index 71eca4f453..4070baaa70 100644 --- a/lib/spack/spack/cmd/activate.py +++ b/lib/spack/spack/cmd/activate.py @@ -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) diff --git a/lib/spack/spack/cmd/deactivate.py b/lib/spack/spack/cmd/deactivate.py index bfec618c8e..c9a4d4b2f6 100644 --- a/lib/spack/spack/cmd/deactivate.py +++ b/lib/spack/spack/cmd/deactivate.py @@ -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) |