summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/llnl/util/link_tree.py4
-rw-r--r--lib/spack/spack/cmd/deactivate.py7
-rw-r--r--lib/spack/spack/cmd/find.py3
3 files changed, 12 insertions, 2 deletions
diff --git a/lib/spack/llnl/util/link_tree.py b/lib/spack/llnl/util/link_tree.py
index 4e4e48316e..4d778eca1e 100644
--- a/lib/spack/llnl/util/link_tree.py
+++ b/lib/spack/llnl/util/link_tree.py
@@ -175,6 +175,10 @@ class LinkTree(object):
kwargs['order'] = 'post'
for src, dest in traverse_tree(self._root, dest_root, **kwargs):
if os.path.isdir(src):
+ # Skip non-existing links.
+ if not os.path.exists(dest):
+ continue
+
if not os.path.isdir(dest):
raise ValueError("File blocks directory: %s" % dest)
diff --git a/lib/spack/spack/cmd/deactivate.py b/lib/spack/spack/cmd/deactivate.py
index fd13f051df..f37dfd79ed 100644
--- a/lib/spack/spack/cmd/deactivate.py
+++ b/lib/spack/spack/cmd/deactivate.py
@@ -31,6 +31,9 @@ description = "Deactivate a package extension."
def setup_parser(subparser):
subparser.add_argument(
+ '-f', '--force', action='store_true',
+ help="Run deactivation even if spec is NOT currently activated.")
+ subparser.add_argument(
'spec', nargs=argparse.REMAINDER, help="spec of package extension to deactivate.")
@@ -44,7 +47,7 @@ def deactivate(parser, args):
spack.db.get(specs[0])
spec = spack.cmd.disambiguate_spec(specs[0])
- if not spec.package.activated:
+ if not args.force and not spec.package.activated:
tty.die("Package %s is not activated." % specs[0].short_spec)
- spec.package.do_deactivate()
+ spec.package.do_deactivate(force=args.force)
diff --git a/lib/spack/spack/cmd/find.py b/lib/spack/spack/cmd/find.py
index f6f503afe5..dee1dfece7 100644
--- a/lib/spack/spack/cmd/find.py
+++ b/lib/spack/spack/cmd/find.py
@@ -122,5 +122,8 @@ def find(parser, args):
if not args.mode:
args.mode = 'short'
+
+ if sys.stdout.isatty():
+ tty.msg("%d installed packages." % len(specs))
display_specs(specs, mode=args.mode)