Hello dear Modules community,
I’m facing a strange « bug » (or « feature 😊) in Modules 5.5.0 around the definition of MANPATH variable.
A bit of context before : I’m running under Redhat 7 Entreprise edition. My shell is tcsh. By default, module 3.2.0 is inititialized (defined by root in /etc/ csh.cshrc) but I’m forcing a swith to 5.5.0 in my own .tcshrc
Before loading any modules, the MANPATH variable is undefined. « manpath » command is returning :
In module 3.2.0 environnment :
/usr/local/share/man:/usr/share/man/overrides:/usr/share/man
In module 5.5.0 environnment :
/home/lbesson/Tools/Modules/5.5.0/share/man:/usr/local/share/man:/usr/share/man/overrides:/usr/share/man:/home/lbesson/share/man:/dpt/adh/flow/digital/man
In module 3.2.0 environnment , $PATH is returning :
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin
In module 5.5.0 environnment :
/home/lbesson/Tools/Modules/5.5.0/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin
Then, I’m loading a module which is adding/defining the MANPATH like this :
prepend-path MANPATH /tool/platform/lsf/8.0/man
After this module load, in Modules 3.2.0, MANPATH value is :
/tool/platform/lsf/8.0/man:/usr/share/man:/usr/local/share/man
While in Modules 5.5.0, I get this :
/tool/platform/lsf/8.0/man
In that case, a simple « man ls » is returning : « No manual entry for ls » . Too bad !
When looking at the modulecmd.tcl code in 5.5.0, around line number 18266, I see this (I have removed comments to compact the lines) :
if {{/home/lbesson/Tools/Modules/5.5.0/bin} ni [split [get-env PATH] :]} {
prepend-path --ignore-refcount PATH {/home/lbesson/Tools/Modules/5.5.0/bin}
}
set manpath {}
catch {set manpath [exec -ignorestderr 2>/dev/null manpath]}
if {{/home/lbesson/Tools/Modules/5.5.0/share/man} ni [split $manpath :]} {
if {![isEnvVarDefined MANPATH]} {
append-path MANPATH {}
} elseif {[envVarEquals MANPATH :]} {
remove-path MANPATH {}
append-path MANPATH {}
}
prepend-path MANPATH {/home/lbesson/Tools/Modules/5.5.0/share/man}
}
There is no usage of $manpath variable, except to check is Modules man page are accessible by « man » command.
I do not have acces to C code of Modules 3.2.0 but I tend to believe it was adding « manpath » value to $MANPATH when loading the first module which is appending/prepending a value to MANPATH
Am I the only one on the Modules planet to face this issue ?
What should be the correct behaviour ?
Thanks for your help,
Laurent.
|