Hi Martin,
When installing Modules the @bindir@ pattern is replaced by the configured
location for Modules utilities. In the bash initialization script produced
(init/bash generated from init/bash.in) this bin location is then added to
the PATH.
The code you spot is made to avoid adding this bin location if it is
already defined in the PATH.
Could you please describe how Modules is built and installed on your side
and how it is initialized and what value of PATH you obtain after this
initialization.
Regards,
Xavier
Le mer. 1 juin 2022 à 16:58, Martin d'Anjou <mar...@gm...> a
écrit :
> Hi,
>
> My PATH keeps growing with the same value of @bindir@ over and over when
> modules is repeatedly initialized, and I suspect that the code below is the
> reason. So inside modules-tcl/init/bash.in, I would like to know the purpose
> of this code
> <https://github.com/cea-hpc/modules/blob/c1fd4dc12f591bb877f392d7307151640573d443/init/bash.in#L68-L72>
> :
>
> @setbinpath@ if [[ ! ":$PATH:" =~ ':@bindir@:' ]]; then
> @setbinpath@@prependbinpath@ PATH=@bindir@${PATH:+:}$PATH
> @setbinpath@@appendbinpath@ PATH=$PATH${PATH:+:}@bindir@
> @setbinpath@ export PATH
> @setbinpath@ fi
>
> Thanks,
> Martin
> _______________________________________________
> Modules-interest mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modules-interest
>
|