summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Beckingsale <davidbeckingsale@gmail.com>2014-07-31 14:56:45 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2014-08-04 07:53:40 -0700
commit57ddbd282aa58b084c1e2f3a2204a6fb9e7ac6e4 (patch)
treed8a43e21688e55829df9732a136f77989562fe2f /lib
parent94c5c9667c786e05a635787e803d2cf7e22de73a (diff)
downloadspack-57ddbd282aa58b084c1e2f3a2204a6fb9e7ac6e4.tar.gz
spack-57ddbd282aa58b084c1e2f3a2204a6fb9e7ac6e4.tar.bz2
spack-57ddbd282aa58b084c1e2f3a2204a6fb9e7ac6e4.tar.xz
spack-57ddbd282aa58b084c1e2f3a2204a6fb9e7ac6e4.zip
Fixed up module support
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/__init__.py2
-rw-r--r--lib/spack/spack/cmd/tclmodule.py6
-rw-r--r--lib/spack/spack/hooks/tclmodule.py13
3 files changed, 11 insertions, 10 deletions
diff --git a/lib/spack/spack/__init__.py b/lib/spack/spack/__init__.py
index bc24766510..0b69ccde38 100644
--- a/lib/spack/spack/__init__.py
+++ b/lib/spack/spack/__init__.py
@@ -59,7 +59,7 @@ stage_path = join_path(var_path, "stage")
install_path = join_path(prefix, "opt")
share_path = join_path(prefix, "share", "spack")
dotkit_path = join_path(share_path, "dotkit")
-tclmodule_path = join_path(share_path, "tclmodule")
+tclmodule_path = join_path(share_path, "modules")
#
# Set up the packages database.
diff --git a/lib/spack/spack/cmd/tclmodule.py b/lib/spack/spack/cmd/tclmodule.py
index da5c4f95fc..270ee65b7b 100644
--- a/lib/spack/spack/cmd/tclmodule.py
+++ b/lib/spack/spack/cmd/tclmodule.py
@@ -70,7 +70,7 @@ def module_find(parser, args):
sys.exit(1)
match = specs[0]
- if not os.path.isfile(spack.hooks.tclmodules.tclmodules_file(match.package)):
+ if not os.path.isfile(spack.hooks.tclmodule.module_file(match.package)):
tty.die("No module is installed for package %s." % spec)
print match.format('$_$@$+$%@$=$#')
@@ -84,8 +84,8 @@ def module_refresh(parser, args):
specs = [s for s in specs
if any(s.satisfies(q) for q in query_specs)]
else:
- shutil.rmtree(spack.module_path, ignore_errors=False)
- mkdirp(spack.module_path)
+ shutil.rmtree(spack.tclmodule_path, ignore_errors=False)
+ mkdirp(spack.tclmodule_path)
for spec in specs:
spack.hooks.tclmodule.post_install(spec.package)
diff --git a/lib/spack/spack/hooks/tclmodule.py b/lib/spack/spack/hooks/tclmodule.py
index 7df41e267c..d9b4a43831 100644
--- a/lib/spack/spack/hooks/tclmodule.py
+++ b/lib/spack/spack/hooks/tclmodule.py
@@ -35,7 +35,7 @@ import spack
def module_file(pkg):
m_file_name = pkg.spec.format('$_$@$%@$+$=$#')
- return join_path(spack.module_path, m_file_name)
+ return join_path(spack.tclmodule_path, m_file_name)
def post_install(pkg):
@@ -51,26 +51,27 @@ def post_install(pkg):
('LD_LIBRARY_PATH', pkg.prefix.lib64)]:
if os.path.isdir(path):
- alterations.append("prepend_path %s %s\n" % (var, path))
+ alterations.append("prepend-path %s \"%s\"\n" % (var, path))
if not alterations:
return
- alterations.append("prepend_path CMAKE_PREFIX_PATH %s\n" % pkg.prefix)
+ alterations.append("prepend-path CMAKE_PREFIX_PATH \"%s\"\n" % pkg.prefix)
m_file = module_file(pkg)
with closing(open(m_file, 'w')) as m:
# Put everything in the spack category.
m.write('#%Module1.0\n')
- m.write('module-whatis \"%s\"\n' % pkg.spec.format("$_ $@"))
+ m.write('module-whatis \"%s\"\n\n' % pkg.spec.format("$_ $@"))
# Recycle the description
if pkg.__doc__:
m.write('proc ModulesHelp { } {\n')
doc = re.sub(r'\s+', ' ', pkg.__doc__)
- m.write("puts str \"%s\"\n" % doc)
- m.write('}')
+ doc = re.sub(r'"', '\"', pkg.__doc__)
+ m.write("puts stderr \"%s\"\n" % doc)
+ m.write('}\n\n')
# Write alterations