modulecmd: setting LD_LIBRARY_PATH fixed

This commit is contained in:
2026-01-29 16:40:51 +01:00
parent 167471c4f4
commit bbf585fcd0
2 changed files with 16 additions and 1 deletions
+3
View File
@@ -3,6 +3,9 @@
## Version 2.0.4
### modulecmd
* When loading multiple modules, `LD_LIBRARY_PATH` may not have
been set correctly.
(#1354)
### build system
+13 -1
View File
@@ -39,6 +39,18 @@ std::def_cmd(){
which "$1" 2>/dev/null || std::die 255 "'$1' not found!"
}
std::def_cmd1(){
local -- name="$1"
local -- bin=''
bin=$(which $1) || std::die 255 "'${name}' not found!"
eval "${name}(){
LD_PRELOAD= ${bin} \"\$@\"
}
declare -g ${name}=${name}
readonly -f ${name}"
}
std::def_cmd2(){
local -- name="$1"
local -- bin=''
@@ -223,7 +235,7 @@ std::def_cmd2 'make'
std::def_cmd2 'md5sum'
std::def_cmd2 'mkdir'
std::def_cmd2 'mktemp'
std::def_cmd2 'modulecmd'
std::def_cmd1 'modulecmd'
std::def_cmd2 'patch'
std::def_cmd2 'pwd'
std::def_cmd2 'readlink'