summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/modules/common.py1
-rw-r--r--lib/spack/spack/test/data/modules/tcl/suffix.yaml1
-rw-r--r--lib/spack/spack/test/modules/tcl.py3
3 files changed, 4 insertions, 1 deletions
diff --git a/lib/spack/spack/modules/common.py b/lib/spack/spack/modules/common.py
index d6fb536e8f..b4e1d553a6 100644
--- a/lib/spack/spack/modules/common.py
+++ b/lib/spack/spack/modules/common.py
@@ -424,6 +424,7 @@ class BaseConfiguration(object):
for constraint, suffix in self.conf.get('suffixes', {}).items():
if constraint in self.spec:
suffixes.append(suffix)
+ suffixes = sorted(set(suffixes))
if self.hash:
suffixes.append(self.hash)
return suffixes
diff --git a/lib/spack/spack/test/data/modules/tcl/suffix.yaml b/lib/spack/spack/test/data/modules/tcl/suffix.yaml
index 015ac63b0f..57703e1733 100644
--- a/lib/spack/spack/test/data/modules/tcl/suffix.yaml
+++ b/lib/spack/spack/test/data/modules/tcl/suffix.yaml
@@ -5,3 +5,4 @@ tcl:
suffixes:
'+debug': foo
'~debug': bar
+ '^mpich': foo
diff --git a/lib/spack/spack/test/modules/tcl.py b/lib/spack/spack/test/modules/tcl.py
index 70eee24461..40cb7be5ef 100644
--- a/lib/spack/spack/test/modules/tcl.py
+++ b/lib/spack/spack/test/modules/tcl.py
@@ -215,9 +215,10 @@ class TestTcl(object):
writer, spec = factory('mpileaks+debug arch=x86-linux')
assert 'foo' in writer.layout.use_name
+ assert 'foo-foo' not in writer.layout.use_name
writer, spec = factory('mpileaks~debug arch=x86-linux')
- assert 'bar' in writer.layout.use_name
+ assert 'bar-foo' in writer.layout.use_name
def test_setup_environment(self, modulefile_content, module_configuration):
"""Tests the internal set-up of run-time environment."""