diff options
author | alalazo <massimiliano.culpo@googlemail.com> | 2016-04-18 13:09:39 +0200 |
---|---|---|
committer | alalazo <massimiliano.culpo@googlemail.com> | 2016-04-18 13:22:50 +0200 |
commit | 50b148ca22b8bc9daeb1cb427eadeefd06e84800 (patch) | |
tree | a7b22bf15f3b9f4c6221a62419f9a97020dffc2e /lib | |
parent | 18a241fe213618a0390a8071480854a5c06e3681 (diff) | |
download | spack-50b148ca22b8bc9daeb1cb427eadeefd06e84800.tar.gz spack-50b148ca22b8bc9daeb1cb427eadeefd06e84800.tar.bz2 spack-50b148ca22b8bc9daeb1cb427eadeefd06e84800.tar.xz spack-50b148ca22b8bc9daeb1cb427eadeefd06e84800.zip |
modules : tcl modules handle 'conflict' directive. This should completely cover the functionality in #498
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/modules.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py index a81132bcac..61ecdc10c3 100644 --- a/lib/spack/spack/modules.py +++ b/lib/spack/spack/modules.py @@ -497,3 +497,19 @@ class TclModule(EnvModule): header += 'puts stderr "%s"\n' % line header += '}\n\n' return header + + def module_specific_content(self, configuration): + naming_tokens = self.tokens + # Conflict + conflict_format = configuration.get('conflict', '') + if conflict_format: + for naming_dir, conflict_dir in zip(self.naming_scheme.split('/'), conflict_format.split('/')): + if naming_dir != conflict_dir: + message = 'Conflict scheme does not match naming scheme [{spec}]\n\n' + message += 'naming scheme : "{nformat}"\n' + message += 'conflict scheme : "{cformat}"\n' + raise tty.error( + message.format(spec=self.spec, nformat=self.naming_scheme, cformat=conflict_format) + ) + conflict_format = 'conflict ' + conflict_format + yield conflict_format.format(**naming_tokens) |