summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2017-10-05 15:12:00 -0400
committerscheibelp <scheibel1@llnl.gov>2017-11-02 18:45:40 -0700
commit650ca7db9e7e69f382f67e9e5f42f2a83da0ec57 (patch)
treea9488c7c0515474fe69bea70376cf72dbbdea46e /lib
parent56bafdc2823234ba108c66df8acf085d8edee851 (diff)
downloadspack-650ca7db9e7e69f382f67e9e5f42f2a83da0ec57.tar.gz
spack-650ca7db9e7e69f382f67e9e5f42f2a83da0ec57.tar.bz2
spack-650ca7db9e7e69f382f67e9e5f42f2a83da0ec57.tar.xz
spack-650ca7db9e7e69f382f67e9e5f42f2a83da0ec57.zip
extensions: add an installed_extensions_for method
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/extensions.py2
-rw-r--r--lib/spack/spack/database.py10
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/spack/spack/cmd/extensions.py b/lib/spack/spack/cmd/extensions.py
index e1f30f7cf3..bda20b9e1c 100644
--- a/lib/spack/spack/cmd/extensions.py
+++ b/lib/spack/spack/cmd/extensions.py
@@ -90,7 +90,7 @@ def extensions(parser, args):
# List specs of installed extensions.
#
installed = [s.spec
- for s in spack.store.db.activated_extensions_for(spec)]
+ for s in spack.store.db.installed_extensions_for(spec)]
print
if not installed:
diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py
index f8334dfa00..90250c11ee 100644
--- a/lib/spack/spack/database.py
+++ b/lib/spack/spack/database.py
@@ -741,6 +741,16 @@ class Database(object):
return relatives
@_autospec
+ def installed_extensions_for(self, extendee_spec):
+ """
+ Return the specs of all packages that extend
+ the given spec
+ """
+ for spec in self.query():
+ if spec.package.extends(extendee_spec):
+ yield spec.package
+
+ @_autospec
def activated_extensions_for(self, extendee_spec):
"""
Return the specs of all packages that extend