forked from spack/spack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modules: append trailing delimiter to MANPATH when set (spack#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 spack#11355.
- Loading branch information
1 parent
bd2f78a
commit 746eaaf
Showing
8 changed files
with
143 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
var/spack/repos/builtin.mock/packages/module-manpath-append/package.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |
17 changes: 17 additions & 0 deletions
17
var/spack/repos/builtin.mock/packages/module-manpath-prepend/package.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# 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 ModuleManpathPrepend(Package): | ||
homepage = "http://www.llnl.gov" | ||
url = "http://www.llnl.gov/module-manpath-prepend-1.0.tar.gz" | ||
|
||
version("1.0", "0123456789abcdef0123456789abcdef") | ||
|
||
def setup_run_environment(self, env): | ||
env.prepend_path("MANPATH", "/path/to/man") | ||
env.prepend_path("MANPATH", "/path/to/share/man") |
16 changes: 16 additions & 0 deletions
16
var/spack/repos/builtin.mock/packages/module-manpath-setenv/package.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ModuleManpathSetenv(Package): | ||
homepage = "http://www.llnl.gov" | ||
url = "http://www.llnl.gov/module-manpath-setenv-1.0.tar.gz" | ||
|
||
version("1.0", "0123456789abcdef0123456789abcdef") | ||
|
||
def setup_run_environment(self, env): | ||
env.set("MANPATH", "/path/to/man") |