Uniquify suffixes added to module names (#14920)

This commit is contained in:
Seth R. Johnson 2020-02-26 12:03:28 -05:00 committed by GitHub
parent 1c227db7a9
commit 6c445a2c0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View File

@ -424,6 +424,7 @@ def suffixes(self):
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

View File

@ -5,3 +5,4 @@ tcl:
suffixes:
'+debug': foo
'~debug': bar
'^mpich': foo

View File

@ -215,9 +215,10 @@ def test_suffixes(self, module_configuration, factory):
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."""