Debian Codegraph @

init/zsh.in

raw
1 unset _mlshdbg;
2 # disable shell debugging for the run of this init file
3 if [ "${MODULES_SILENT_SHELL_DEBUG:-0}" = '1' ]; then
4 # immediately disable debugging to echo the less number of line possible
5 case "$-" in
6 *v*x*) set +vx; _mlshdbg='vx' ;;
7 *v*) set +v; _mlshdbg='v' ;;
8 *x*) set +x; _mlshdbg='x' ;;
9 *) _mlshdbg='' ;;
10 esac;
11 fi;
12
13 # define modules runtime quarantine configuration
14 @setquarvars@export MODULES_RUN_QUARANTINE='@RUN_QUARANTINE@'
15 @setquarvars@@export RUNENV_VAR='RUNENV_VAL'@
16 @notsetquarvars@#export MODULES_RUN_QUARANTINE='ENVVARNAME'
17 @notsetquarvars@
18 # setup quarantine if defined
19 unset _mlre _mlIFS;
20 if [ -n "${IFS+x}" ]; then
21 _mlIFS=$IFS;
22 fi;
23 IFS=' ';
24 for _mlv in ${=MODULES_RUN_QUARANTINE:-}; do
25 if [ "${_mlv}" = "${_mlv##*[!A-Za-z0-9_]}" -a "${_mlv}" = "${_mlv#[0-9]}" ]; then
26 if [ -n "$(eval 'echo ${'$_mlv'+x}')" ]; then
27 _mlre="${_mlre:-}__MODULES_QUAR_${_mlv}='$(eval 'echo ${'$_mlv'}')' ";
28 fi;
29 _mlrv="MODULES_RUNENV_${_mlv}";
30 _mlre="${_mlre:-}${_mlv}='$(eval 'echo ${'$_mlrv':-}')' ";
31 fi;
32 done;
33 if [ -n "${_mlre:-}" ]; then
34 _mlre="eval ${_mlre}__MODULES_QUARANTINE_SET=1 ";
35 fi;
36
37 # define module command and surrounding initial environment (default value
38 # for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files)
39 _mlcode=$(${^^=_mlre:-}@TCLSH@ '@libexecdir@/modulecmd.tcl' zsh autoinit)
40 _mlret=$?
41
42 # clean temp variables used to setup quarantine
43 if [ -n "${_mlIFS+x}" ]; then
44 IFS=$_mlIFS;
45 unset _mlIFS;
46 else
47 unset IFS;
48 fi;
49 unset _mlre _mlv _mlrv
50
51 # no environment alteration if the above autoinit command failed
52 if [ $_mlret -eq 0 ]; then
53 eval "$_mlcode"
54 @setzshfpath@
55 @setzshfpath@ # setup FPATH to put module completion at hand in case zsh completion enabled
56 @setzshfpath@ # cannot be configured by autoinit as FPATH is not an environment variable
57 @setzshfpath@ if [[ ! ":$FPATH:" =~ ':@initdir@/zsh-functions:' ]]; then
58 @setzshfpath@ FPATH="@initdir@/zsh-functions${FPATH:+:}$FPATH"
59 @setzshfpath@ fi
60 fi
61
62 unset _mlcode _mlret
63
64 # restore shell debugging options if disabled
65 if [ -n "${_mlshdbg:-}" ]; then
66 set -$_mlshdbg;
67 unset _mlshdbg;
68 fi;