Dear Laurent and Paul,
The difference between the 2 implementations is that Modules 3 sets
MANPATH to "/usr/share/man:/usr/local/share/man" when it initializes
this environment variable.
Modules 4 and newer versions do not perform any specific setup based
on environment variable name.
What I suggest for MANPATH is to initialize this environment variable
to ":" to ask man to look at system man paths (what returns manpath by
default) in addition to looking at specific paths enabled by
modulefiles. This initialization may be done within the etc/initrc
file.
Best regards,
Xavier
Le jeu. 20 févr. 2025 à 15:23, Paul Markfort <pau...@gm...> a écrit :
>
> Interesting.
>
> It looks like you are installing from source (by the install location).
>
> When I installed 5.5.0, I used the config options: --disable-set-binpath --disable-set-manpath
> Maybe you need to use: --disable-set-binpath
>
>
> My copy (as installed) looks exactly like the below in that section (it is completely commented out).
>
>
> if {[getState shelltype] in {sh csh fish}} {
> # add Modules bin directory to PATH if enabled but do not increase ref
> # counter variable if already there
> ##nagelfar ignore #26 Strange command
> #if {{/stage/site/modules/5.5.0/bin} ni [split [get-env PATH] :]} {
> #prepend-path --ignore-refcount PATH {/stage/site/modules/5.5.0/bin}
> #}
>
> # add Modules man directory to MANPATH if enabled
> # initialize MANPATH if not set with a value that preserves manpath
> # system configuration even after addition of paths to this variable by
> # modulefiles
> #set manpath {}
> # use manpath tool if found at configure step, use MANPATH otherwise
> ##nagelfar ignore +2 Too long line
> ##nagelfar ignore Found constant
> #catch {set manpath [exec -ignorestderr 2>/dev/null manpath]}
> ##if {[isEnvVarDefined MANPATH]} {
> ## set manpath $::env(MANPATH)
> ##}
> #if {{/stage/site/modules/5.5.0/share/man} ni [split $manpath :]} {
> # if {![isEnvVarDefined MANPATH]} {
> # append-path MANPATH {}
> # # ensure no duplicate ':' is set
> # } elseif {[envVarEquals MANPATH :]} {
> # remove-path MANPATH {}
> # append-path MANPATH {}
> # }
> # prepend-path MANPATH {/stage/site/modules/5.5.0/share/man}
> #}
> }
>
> On 2025-02-20 3:20 AM, Laurent BESSON wrote:
> > 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}
> > }
> >
> > I think adding « /home/lbesson/Tools/Modules/5.5.0/bin » in $PATH has made « manapth » to return
> >
> >
> >
> >
> > _______________________________________________
> > Modules-interest mailing list
> > Mod...@li...
> > https://lists.sourceforge.net/lists/listinfo/modules-interest
> >
>
> --
> --------------------------------------------------------
> The views and opinions expressed above are strictly
> those of the author(s). The content of this message has
> not been reviewed nor approved by any entity whatsoever.
> --------------------------------------------------------
> Paul FM Info: http://paulfm.com/~paulfm/
> --------------------------------------------------------
>
>
> _______________________________________________
> Modules-interest mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modules-interest
|