Skip to content

Commit

Permalink
modules : tcl modules handle 'conflict' directive. This should comple…
Browse files Browse the repository at this point in the history
…tely cover the functionality in spack#498
  • Loading branch information
alalazo committed Apr 18, 2016
1 parent b60061f commit ea6c146
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/spack/spack/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,3 +497,19 @@ def header(self):
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)

0 comments on commit ea6c146

Please sign in to comment.