Skip to content
Snippets Groups Projects
Commit c69acfa5 authored by Massimiliano Culpo's avatar Massimiliano Culpo
Browse files

naming work correctly

parent 00f44d55
No related branches found
No related tags found
No related merge requests found
...@@ -276,8 +276,7 @@ def tokens(self): ...@@ -276,8 +276,7 @@ def tokens(self):
tokens = { tokens = {
'name': self.spec.name, 'name': self.spec.name,
'version': self.spec.version, 'version': self.spec.version,
'compiler': self.spec.compiler, 'compiler': self.spec.compiler
'hash': self.spec.dag_hash()
} }
return tokens return tokens
...@@ -289,6 +288,10 @@ def use_name(self): ...@@ -289,6 +288,10 @@ def use_name(self):
naming_tokens = self.tokens naming_tokens = self.tokens
naming_scheme = self.naming_scheme naming_scheme = self.naming_scheme
name = naming_scheme.format(**naming_tokens) name = naming_scheme.format(**naming_tokens)
name += '-' + self.spec.dag_hash() # Always append the hash to make the module file unique
# Not everybody is working on linux...
parts = name.split('/')
name = join_path(*parts)
return name return name
@property @property
...@@ -430,7 +433,7 @@ class Dotkit(EnvModule): ...@@ -430,7 +433,7 @@ class Dotkit(EnvModule):
prerequisite_format = None # TODO : does something like prerequisite exist for dotkit? prerequisite_format = None # TODO : does something like prerequisite exist for dotkit?
default_naming_format = '{name}-{version}-{compiler.name}-{compiler.version}-{hash}' default_naming_format = '{name}-{version}-{compiler.name}-{compiler.version}'
@property @property
def file_name(self): def file_name(self):
...@@ -473,7 +476,7 @@ class TclModule(EnvModule): ...@@ -473,7 +476,7 @@ class TclModule(EnvModule):
prerequisite_format = 'prereq {module_file}\n' prerequisite_format = 'prereq {module_file}\n'
default_naming_format = '{name}-{version}-{compiler.name}-{compiler.version}-{hash}' default_naming_format = '{name}-{version}-{compiler.name}-{compiler.version}'
@property @property
def file_name(self): def file_name(self):
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
# commands. This allows the user to use packages without knowing all # commands. This allows the user to use packages without knowing all
# their installation details. # their installation details.
# #
# e.g., rather than requring a full spec for libelf, the user can type: # e.g., rather than requiring a full spec for libelf, the user can type:
# #
# spack use libelf # spack use libelf
# #
...@@ -110,11 +110,11 @@ function spack { ...@@ -110,11 +110,11 @@ function spack {
unuse $_sp_module_args $_sp_full_spec unuse $_sp_module_args $_sp_full_spec
fi ;; fi ;;
"load") "load")
if _sp_full_spec=$(command spack $_sp_flags module find dotkit $_sp_spec); then if _sp_full_spec=$(command spack $_sp_flags module find tcl $_sp_spec); then
module load $_sp_module_args $_sp_full_spec module load $_sp_module_args $_sp_full_spec
fi ;; fi ;;
"unload") "unload")
if _sp_full_spec=$(command spack $_sp_flags module find dotkit $_sp_spec); then if _sp_full_spec=$(command spack $_sp_flags module find tcl $_sp_spec); then
module unload $_sp_module_args $_sp_full_spec module unload $_sp_module_args $_sp_full_spec
fi ;; fi ;;
esac esac
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment