Files
modules/init/fish.in
Xavier Delaruelle fc690085b0 Use '__MODULES_QUAR_' prefix on env var set in quarantine
Rename the environment variables used to indirectly pass to
`modulecmd.tcl` the value of variables set in quarantine (variables
whose name finishes with `_modquar`). A `__MODULES_QUAR_` prefix is
applied to the name of these variables instead of the `_modquar` suffix
to indicate they are intended for Modules internal use of only.
2021-07-25 10:17:04 +02:00

59 lines
2.7 KiB
Plaintext

@quarantinesupport@# define modules runtine quarantine configuration
@quarantinesupport@@setquarvars@set -xg MODULES_RUN_QUARANTINE '@RUN_QUARANTINE@'
@quarantinesupport@@setquarvars@@set -xg RUNENV_VAR 'RUNENV_VAL'@
@quarantinesupport@@notsetquarvars@#set -xg MODULES_RUN_QUARANTINE 'ENVVARNAME'
@quarantinesupport@@notsetquarvars@
@quarantinesupport@# setup quarantine if defined
@quarantinesupport@set _mlre '';
@quarantinesupport@for _mlv in (string split ' ' $MODULES_RUN_QUARANTINE)
@quarantinesupport@ if string match -r '^[A-Za-z_][A-Za-z0-9_]*$' $_mlv >/dev/null
@quarantinesupport@ if set -q $_mlv
@quarantinesupport@ set _mlre $_mlre"__MODULES_QUAR_"$_mlv"='$$_mlv' "
@quarantinesupport@ end
@quarantinesupport@ set _mlrv "MODULES_RUNENV_$_mlv"
@quarantinesupport@ set _mlre "$_mlre$_mlv='$$_mlrv' "
@quarantinesupport@ end
@quarantinesupport@end
@quarantinesupport@if [ -n "$_mlre" ]
@quarantinesupport@ set _mlre "env $_mlre"
@quarantinesupport@end
@quarantinesupport@
# define module command and surrounding initial environment (default value
# for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files)
@quarantinesupport@eval $_mlre @TCLSH@ @libexecdir@/modulecmd.tcl fish autoinit | source -
@notquarantinesupport@eval @TCLSH@ @libexecdir@/modulecmd.tcl fish autoinit | source -
# no environment alteration if the above autoinit command failed
if [ $status -eq 0 ]
if status -i
if [ -r @initdir@/fish_completion ]
source @initdir@/fish_completion
end
end
@setbinpath@ if not contains @bindir@ $PATH
@setbinpath@@prependbinpath@ set -xg PATH @bindir@ $PATH
@setbinpath@@appendbinpath@ set -xg PATH $PATH @bindir@
@setbinpath@ end
@setbinpath@
@setmanpath@ # initialize MANPATH if not set with a value that preserves manpath system
@setmanpath@ # configuration even after addition of paths to this variable by modulefiles
@setmanpath@ if not set -q MANPATH
@setmanpath@ set -xg MANPATH :
@setmanpath@ end
@setmanpath@@usemanpath@ if not string match -q '*:@mandir@:*' :(manpath 2>/dev/null):
@setmanpath@@notusemanpath@ if not string match -q '*:@mandir@:*' :$MANPATH:
@setmanpath@ if [ -z "$MANPATH" -o "$MANPATH" = ':' ]
@setmanpath@ set _mlpathsep ''
@setmanpath@ else
@setmanpath@ set _mlpathsep :
@setmanpath@ end
@setmanpath@@prependmanpath@ set -xg MANPATH @mandir@$_mlpathsep$MANPATH
@setmanpath@@appendmanpath@ set -xg MANPATH $MANPATH$_mlpathsep@mandir@
@setmanpath@ set -e _mlpathsep
@setmanpath@ end
end
@quarantinesupport@
@quarantinesupport@# clean temp variables used to setup quarantine
@quarantinesupport@set -e _mlre; set -e _mlv; set -e _mlrv;