summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/package_base.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/spack/spack/package_base.py b/lib/spack/spack/package_base.py
index 50ea97a9d4..82d04afb97 100644
--- a/lib/spack/spack/package_base.py
+++ b/lib/spack/spack/package_base.py
@@ -199,10 +199,10 @@ class DetectablePackageMeta(type):
# assumed to be detectable
if hasattr(cls, "executables") or hasattr(cls, "libraries"):
# Append a tag to each detectable package, so that finding them is faster
- if hasattr(cls, "tags"):
- getattr(cls, "tags").append(DetectablePackageMeta.TAG)
- else:
+ if not hasattr(cls, "tags"):
setattr(cls, "tags", [DetectablePackageMeta.TAG])
+ elif DetectablePackageMeta.TAG not in cls.tags:
+ cls.tags.append(DetectablePackageMeta.TAG)
@classmethod
def platform_executables(cls):