mirror of
https://github.com/envmodules/modules.git
synced 2026-06-14 00:42:43 +08:00
Take into account Modules initialization configurations found in ``etc`` directory if they exist rather in ``init`` directory. If ``initrc`` configuration file is found in ``etcdir`` then it is preferred over ``modulerc`` file in ``initdir``. Following the same trend, ``modulespath`` configuration file is found in ``etcdir`` then it is preferred over ``.modulespath`` file in ``initdir``.
34 lines
1.8 KiB
Plaintext
34 lines
1.8 KiB
Plaintext
@quarantinesupport@# define modules runtine quarantine configuration
|
|
@quarantinesupport@@setquarvars@set env(MODULES_RUN_QUARANTINE) "@RUN_QUARANTINE@"
|
|
@quarantinesupport@@setquarvars@@set env(RUNENV_VAR) "RUNENV_VAL"@
|
|
@quarantinesupport@@notsetquarvars@#set env(MODULES_RUN_QUARANTINE) "ENVVARNAME"
|
|
@quarantinesupport@@notsetquarvars@
|
|
@quarantinesupport@# setup quarantine if defined
|
|
@quarantinesupport@set _mlre {}; set _mlv ""; set _mlrv "";
|
|
@quarantinesupport@if {[info exists env(MODULES_RUN_QUARANTINE)]} {
|
|
@quarantinesupport@ foreach _mlv [split $env(MODULES_RUN_QUARANTINE) " "] {
|
|
@quarantinesupport@ if {[regexp {^[A-Za-z_][A-Za-z0-9_]*$} $_mlv]} {
|
|
@quarantinesupport@ if {[info exists env($_mlv)]} {
|
|
@quarantinesupport@ lappend _mlre "${_mlv}_modquar=$env($_mlv)"
|
|
@quarantinesupport@ }
|
|
@quarantinesupport@ set _mlrv "MODULES_RUNENV_${_mlv}"
|
|
@quarantinesupport@ if {[info exists env($_mlrv)]} {
|
|
@quarantinesupport@ lappend _mlre "${_mlv}=$env($_mlrv)"
|
|
@quarantinesupport@ } else {
|
|
@quarantinesupport@ lappend _mlre "${_mlv}="
|
|
@quarantinesupport@ }
|
|
@quarantinesupport@ }
|
|
@quarantinesupport@ }
|
|
@quarantinesupport@ if {[llength $_mlre] > 0} {
|
|
@quarantinesupport@ set _mlre [linsert $_mlre 0 "env"]
|
|
@quarantinesupport@ }
|
|
@quarantinesupport@}
|
|
@quarantinesupport@
|
|
# define module command and surrounding initial environment (default value
|
|
# for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files)
|
|
@quarantinesupport@eval [eval exec $_mlre "@TCLSH@" "@libexecdir@/modulecmd.tcl" "tcl" "autoinit" 2>@stderr]
|
|
@notquarantinesupport@eval [exec "@TCLSH@" "@libexecdir@/modulecmd.tcl" "tcl" "autoinit" 2>@stderr]
|
|
@quarantinesupport@
|
|
@quarantinesupport@# clean temp variables used to setup quarantine
|
|
@quarantinesupport@unset _mlre _mlv _mlrv
|