summaryrefslogtreecommitdiff
path: root/lib/spack/spack/cmd/deactivate.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/spack/cmd/deactivate.py')
-rw-r--r--lib/spack/spack/cmd/deactivate.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/spack/spack/cmd/deactivate.py b/lib/spack/spack/cmd/deactivate.py
index 990309ee48..fedd078972 100644
--- a/lib/spack/spack/cmd/deactivate.py
+++ b/lib/spack/spack/cmd/deactivate.py
@@ -27,10 +27,12 @@ import llnl.util.tty as tty
import spack
import spack.cmd
+import spack.store
from spack.graph import topological_sort
description = "Deactivate a package extension."
+
def setup_parser(subparser):
subparser.add_argument(
'-f', '--force', action='store_true',
@@ -40,7 +42,8 @@ def setup_parser(subparser):
help="Deactivate all extensions of an extendable package, or "
"deactivate an extension AND its dependencies.")
subparser.add_argument(
- 'spec', nargs=argparse.REMAINDER, help="spec of package extension to deactivate.")
+ 'spec', nargs=argparse.REMAINDER,
+ help="spec of package extension to deactivate.")
def deactivate(parser, args):
@@ -54,7 +57,7 @@ def deactivate(parser, args):
if args.all:
if pkg.extendable:
tty.msg("Deactivating all extensions of %s" % pkg.spec.short_spec)
- ext_pkgs = spack.installed_db.installed_extensions_for(spec)
+ ext_pkgs = spack.store.db.installed_extensions_for(spec)
for ext_pkg in ext_pkgs:
ext_pkg.spec.normalize()
@@ -65,7 +68,8 @@ def deactivate(parser, args):
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)
+ tty.msg("Deactivating %s and all dependencies." %
+ pkg.spec.short_spec)
topo_order = topological_sort(spec)
index = spec.index()
@@ -79,7 +83,9 @@ def deactivate(parser, args):
epkg.do_deactivate(force=args.force)
else:
- tty.die("spack deactivate --all requires an extendable package or an extension.")
+ tty.die(
+ "spack deactivate --all requires an extendable package "
+ "or an extension.")
else:
if not pkg.is_extension: