summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin.mock/packages/module-manpath-append
diff options
context:
space:
mode:
authorXavier Delaruelle <xavier.delaruelle@cea.fr>2023-06-13 10:29:11 +0200
committerGitHub <noreply@github.com>2023-06-13 10:29:11 +0200
commit746eaaf01ac824caa9649b368249b5a6ebdb2311 (patch)
treea4b22c28b424d63e63cf3530df9f5c5b9dbb2490 /var/spack/repos/builtin.mock/packages/module-manpath-append
parentbd2f78ae9a0a27a72e4476c08e2587262e8d8efd (diff)
downloadspack-746eaaf01ac824caa9649b368249b5a6ebdb2311.tar.gz
spack-746eaaf01ac824caa9649b368249b5a6ebdb2311.tar.bz2
spack-746eaaf01ac824caa9649b368249b5a6ebdb2311.tar.xz
spack-746eaaf01ac824caa9649b368249b5a6ebdb2311.zip
modules: append trailing delimiter to MANPATH when set (#36678)
Update modulefile templates to append a trailing delimiter to MANPATH environment variable, if the modulefile sets it. With a trailing delimiter at ends of MANPATH's value, man will search the system man pages after searching the specific paths set. Using append-path/append_path to add this element, the module tool ensures it is appended only once. When modulefile is unloaded, the number of append attempt is decreased, thus the trailing delimiter is removed only if this number equals 0. Disclaimer: no path element should be appended to MANPATH by generated modulefiles. It should always be prepended to ensure this variable's value ends with the trailing delimiter. Fixes #11355.
Diffstat (limited to 'var/spack/repos/builtin.mock/packages/module-manpath-append')
-rw-r--r--var/spack/repos/builtin.mock/packages/module-manpath-append/package.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/module-manpath-append/package.py b/var/spack/repos/builtin.mock/packages/module-manpath-append/package.py
new file mode 100644
index 0000000000..5f31d17a8f
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/module-manpath-append/package.py
@@ -0,0 +1,16 @@
+# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack.package import *
+
+
+class ModuleManpathAppend(Package):
+ homepage = "http://www.llnl.gov"
+ url = "http://www.llnl.gov/module-manpath-append-1.0.tar.gz"
+
+ version("1.0", "0123456789abcdef0123456789abcdef")
+
+ def setup_run_environment(self, env):
+ env.append_path("MANPATH", "/path/to/man")