Files
modules/init/fish.in
Xavier Delaruelle d918ee6d86 install: add --with-quarantine-vars
Add --with-quarantine-vars configure option to define quarantine
mechanism configuration at build time.

Value passed to the configure option will be used by Makefile to
initialize in the various initialization scripts the
MODULES_RUN_QUARANTINE variable and eventual MODULES_RUNENV_<VAR>.
2017-11-12 16:56:40 +01:00

54 lines
1.8 KiB
Plaintext

# define modules runtine quarantine configuration
@setquarvars@set -xg MODULES_RUN_QUARANTINE '@RUN_QUARANTINE@'
@setquarvars@@set -xg RUNENV_VAR 'RUNENV_VAL'@
@notsetquarvars@#set -xg MODULES_RUN_QUARANTINE 'ENVVARNAME'
@notsetquarvars@
# setup quarantine if defined
set _mlre '';
for _mlv in (string split ' ' $MODULES_RUN_QUARANTINE)
if string match -r '^[A-Za-z_][A-Za-z0-9_]*$' $_mlv >/dev/null
if set -q $_mlv
set _mlre $_mlre$_mlv"_modquar='$$_mlv' "
end
set _mlrv "MODULES_RUNENV_$_mlv"
set _mlre "$_mlre$_mlv='$$_mlrv' "
end
end
if [ -n "$_mlre" ]
set _mlre "env $_mlre"
end
# define module command and surrounding initial environment (default value
# for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init/.modulespath)
eval $_mlre @TCLSH@ @libexecdir@/modulecmd.tcl fish autoinit | source -
# clean temp variables used to setup quarantine
set -e _mlre; set -e _mlv; set -e _mlrv;
if status -i
if [ -r @initdir@/fish_completion ]
source @initdir@/fish_completion
end
end
@compatversion@# no switchml definition since there is no Fish support in C version
@compatversion@
# setup ENV variables to get module defined in sub-shells (works for 'sh'
# and 'ksh' in interactive mode and 'sh' (zsh-compat), 'bash' and 'ksh'
# (zsh-compat) in non-interactive mode.
set -xg ENV @initdir@/profile.sh
set -xg BASH_ENV @initdir@/bash
@setbinpath@if not contains @bindir@ $PATH
@setbinpath@ set -xg PATH @bindir@ $PATH
@setbinpath@end
@setbinpath@
@setmanpath@set manpath (manpath ^/dev/null)
@setmanpath@if not string match -q '*:@mandir@:*' :$manpath:
@setmanpath@ if [ -z $manpath ]
@setmanpath@ set -xg MANPATH @mandir@
@setmanpath@ else
@setmanpath@ set -xg MANPATH @mandir@:$manpath
@setmanpath@ end
@setmanpath@end