summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2016-04-15 12:21:32 +0200
committeralalazo <massimiliano.culpo@googlemail.com>2016-04-18 13:22:04 +0200
commitc69acfa5c80fc4ea93787c19f9f4a6f3cf833f9c (patch)
tree37c9c60d78ac7928269ca150aaed526578dbad14
parent00f44d558ab3b3ee4b9d04534a01ad7decbe0d7b (diff)
downloadspack-c69acfa5c80fc4ea93787c19f9f4a6f3cf833f9c.tar.gz
spack-c69acfa5c80fc4ea93787c19f9f4a6f3cf833f9c.tar.bz2
spack-c69acfa5c80fc4ea93787c19f9f4a6f3cf833f9c.tar.xz
spack-c69acfa5c80fc4ea93787c19f9f4a6f3cf833f9c.zip
naming work correctly
-rw-r--r--lib/spack/spack/modules.py11
-rwxr-xr-xshare/spack/setup-env.sh6
2 files changed, 10 insertions, 7 deletions
diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py
index e6e9be1eff..a24d5e5d09 100644
--- a/lib/spack/spack/modules.py
+++ b/lib/spack/spack/modules.py
@@ -276,8 +276,7 @@ class EnvModule(object):
tokens = {
'name': self.spec.name,
'version': self.spec.version,
- 'compiler': self.spec.compiler,
- 'hash': self.spec.dag_hash()
+ 'compiler': self.spec.compiler
}
return tokens
@@ -289,6 +288,10 @@ class EnvModule(object):
naming_tokens = self.tokens
naming_scheme = self.naming_scheme
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
@property
@@ -430,7 +433,7 @@ class Dotkit(EnvModule):
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
def file_name(self):
@@ -473,7 +476,7 @@ class TclModule(EnvModule):
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
def file_name(self):
diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh
index 764af68400..0c9e5b2409 100755
--- a/share/spack/setup-env.sh
+++ b/share/spack/setup-env.sh
@@ -41,7 +41,7 @@
# commands. This allows the user to use packages without knowing all
# 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
#
@@ -110,11 +110,11 @@ function spack {
unuse $_sp_module_args $_sp_full_spec
fi ;;
"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
fi ;;
"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
fi ;;
esac