D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
proc
/
self
/
root
/
home
/
vblioqus
/
karachi777.vip
/
in
/
106014
/
900508
/
Filename :
init.tar
back
Copy
profile.csh 0000644 00000000151 15152714332 0006703 0 ustar 00 if ($?tcsh) then source /usr/share/Modules/init/tcsh else source /usr/share/Modules/init/csh endif tcsh_completion 0000644 00000012621 15152714332 0007666 0 ustar 00 # # Tcsh commandline completion # alias _module_avail '\\ /usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl tcsh avail --color=never -s -t -S |& sed '"'"'\\ /^-\+/d; /^\s*$/d; \\ /->.*$/d; \\ /:$/d; \\ s#^\(.*\)/\(.\+\)(.*default.*)#\1\n\1\/\2#; \\ s#(.*)$##g; \\ s#\s*$##g; \\ s#/*$##g; '"'" alias _module_loaded '\\ /usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl tcsh list --color=never -s -t |& sed '"'"'\\ /No Modulefiles Currently Loaded\.$/d; \\ /^-\+/d; /^\s*$/d; \\ /->.*$/d; \\ /:$/d; \\ s#^\(.*\)/\(.\+\)(.*default.*)#\1\n\1\/\2#; \\ s#(.*)$##g; \\ s#/*$##g; '"'" alias _module_savelist '\\ /usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl tcsh savelist --color=never -s -t |& sed '"'"'\\ /No named collection\.$/d; \\ /Named collection list$/d; \\ /:$/d; '"'" alias _module_not_yet_loaded '\\ mkfifo /tmp/modules_tcsh_completion.$$.p1 /tmp/modules_tcsh_completion.$$.p2 && \\ ( _module_avail | sort >! /tmp/modules_tcsh_completion.$$.p1 & ); \\ ( _module_loaded | sort >! /tmp/modules_tcsh_completion.$$.p2 & ); \\ comm -23 /tmp/modules_tcsh_completion.$$.p1 /tmp/modules_tcsh_completion.$$.p2; \\ \rm /tmp/modules_tcsh_completion.$$.p1 /tmp/modules_tcsh_completion.$$.p2' alias _module_modulepath 'echo ${MODULEPATH} | sed '"'"'s/:/\n/g;'"'"' ' set module_cmds = "add apropos aliases avail append-path clear config del display help initadd initclear initlist initprepend initrm is-loaded is-saved is-used is-avail info-loaded keyword list load path paths purge prepend-path refresh reload restore rm remove remove-path save savelist saveshow saverm search show source swap switch test unload unuse use whatis" set module_opts = "-D -h -s -v -V --debug --help --silent --verbose --version --paginate --no-pager --color --color=" set module_load_opts = "--auto --no-auto --force -f --icase -i" set module_list_opts = "-j -l -t --json --long --terse" set module_clear_opts = "--force -f" set module_avail_opts = "-C -d -i -j -L -l -S -t --contains --default --icase --json --latest --long --starts-with --terse --indepth --no-indepth" set module_mfile_opts = "-i --icase" set module_whatis_opts = "-i -j --icase --json" set module_search_opts = "-j --json" set module_path_opts = "-d --delim --duplicates" set module_rm_path_opts = "-d --delim --index" set module_config_opts = "--dump-state --reset advanced_version_spec auto_handling avail_indepth collection_pin_version collection_target color colors contact extended_default extra_siteconfig home icase implicit_default locked_configs ml pager rcfile run_quarantine search_match set_shell_startup silent_shell_debug term_background unload_match_order verbosity wa_277" complete module 'n/help/`_module_avail`/' \ 'n/add/`_module_not_yet_loaded; echo ${module_load_opts}`/' \ 'n/load/`_module_not_yet_loaded; echo ${module_load_opts}`/' \ 'n/rm/`_module_loaded; echo ${module_load_opts}`/' \ 'n/del/`_module_loaded; echo ${module_load_opts}`/' \ 'n/remove/`_module_loaded; echo ${module_load_opts}`/' \ 'n/unload/`_module_loaded; echo ${module_load_opts}`/' \ 'n/swap/`_module_loaded; echo ${module_load_opts}`/' \ 'N/swap/`_module_not_yet_loaded; echo ${module_load_opts}`/' \ 'n/switch/`_module_loaded; echo ${module_load_opts}`/' \ 'N/switch/`_module_not_yet_loaded; echo ${module_load_opts}`/' \ 'n/show/`_module_avail; echo ${module_mfile_opts}`/' \ 'n/display/`_module_avail; echo ${module_mfile_opts}`/' \ 'n/test/`_module_avail; echo ${module_mfile_opts}`/' \ "n/list/(${module_list_opts})/" \ 'n/avail/`_module_avail; echo ${module_avail_opts}`/' \ 'n/is-avail/`_module_avail; echo ${module_mfile_opts}`/' \ 'n/is-loaded/`_module_avail; echo ${module_mfile_opts}`/' \ 'n/info-loaded/`_module_avail; echo ${module_mfile_opts}`/' \ 'n/restore/`_module_savelist`/' \ "n/savelist/(${module_list_opts})/" \ 'n/saveshow/`_module_savelist`/' \ 'n/saverm/`_module_savelist`/' \ 'n/save/`_module_savelist`/' \ 'n/is-saved/`_module_savelist`/' \ 'n/aliases/n/' \ 'n/use/d/' \ 'N/use/d/' \ 'n/unuse/`_module_modulepath`/' \ 'n/is-used/`_module_modulepath`/' \ 'n/purge/n/' \ 'n/refresh/n/' \ 'n/reload/n/' \ 'n/whatis/`_module_avail; echo ${module_whatis_opts}`/' \ "n/apropos/(${module_search_opts})/" \ "n/search/(${module_search_opts})/" \ "n/keyword/(${module_search_opts})/" \ 'n/paths/`_module_avail; echo ${module_mfile_opts}`/' \ 'n/path/`_module_avail; echo ${module_mfile_opts}`/' \ 'n/source/n/' \ 'n/initadd/n/' \ 'n/initprepend/n/' \ 'n/initrm/n/' \ 'n/initlist/n/' \ 'n/initclear/n/' \ "n/append-path/(${module_path_opts})/" \ "n/prepend-path/(${module_path_opts})/" \ "n/remove-path/(${module_rm_path_opts})/" \ "n/clear/(${module_clear_opts})/" \ "n/config/(${module_config_opts})/" \ "n/--reset/(${module_config_opts})/" \ 'n/-h/n/' \ 'n/--help/n/' \ 'n/-V/n/' \ 'n/--version/n/' \ 'C/sw*/(switch)/' \ "p/1/(${module_cmds} ${module_opts})/" \ "n/-*/(${module_cmds})/" zsh 0000644 00000010067 15152714332 0005302 0 ustar 00 unset _mlshdbg; # disable shell debugging for the run of this init file if [ "${MODULES_SILENT_SHELL_DEBUG:-0}" = '1' ]; then # immediately disable debugging to echo the less number of line possible case "$-" in *v*x*) set +vx; _mlshdbg='vx' ;; *v*) set +v; _mlshdbg='v' ;; *x*) set +x; _mlshdbg='x' ;; *) _mlshdbg='' ;; esac; fi; # define modules runtine quarantine configuration export MODULES_RUN_QUARANTINE='LD_LIBRARY_PATH LD_PRELOAD' # setup quarantine if defined unset _mlre _mlIFS; if [ -n "${IFS+x}" ]; then _mlIFS=$IFS; fi; IFS=' '; for _mlv in ${=MODULES_RUN_QUARANTINE:-}; do if [ "${_mlv}" = "${_mlv##*[!A-Za-z0-9_]}" -a "${_mlv}" = "${_mlv#[0-9]}" ]; then if [ -n "`eval 'echo ${'$_mlv'+x}'`" ]; then _mlre="${_mlre:-}${_mlv}_modquar='`eval 'echo ${'$_mlv'}'`' "; fi; _mlrv="MODULES_RUNENV_${_mlv}"; _mlre="${_mlre:-}${_mlv}='`eval 'echo ${'$_mlrv':-}'`' "; fi; done; if [ -n "${_mlre:-}" ]; then _mlre="eval ${_mlre}"; fi; # define module command and surrounding initial environment (default value # for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files) _mlcode=`${=_mlre:-}/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl zsh autoinit` _mlret=$? # clean temp variables used to setup quarantine if [ -n "${_mlIFS+x}" ]; then IFS=$_mlIFS; unset _mlIFS; else unset IFS; fi; unset _mlre _mlv _mlrv # no environment alteration if the above autoinit command failed if [ $_mlret -eq 0 ]; then eval "$_mlcode" # redefine module command if compat version has been activated if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then MODULES_CMD=/usr/share/Modules/libexec/modulecmd-compat export MODULES_CMD if [ -t 2 ]; then _module_raw() { eval `/usr/share/Modules/libexec/modulecmd-compat zsh $*`; } else module() { eval `/usr/share/Modules/libexec/modulecmd-compat zsh $*`; } fi fi # define function to switch between C and Tcl versions of Modules switchml() { typeset swfound=1 if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then typeset swname='main' if [ -e /usr/share/Modules/libexec/modulecmd.tcl ]; then typeset swfound=0 unset MODULES_USE_COMPAT_VERSION fi else typeset swname='compatibility' if [ -e /usr/share/Modules/libexec/modulecmd-compat ]; then typeset swfound=0 MODULES_USE_COMPAT_VERSION=1 export MODULES_USE_COMPAT_VERSION fi fi # switch version only if command found if [ $swfound -eq 0 ]; then echo "Switching to Modules $swname version" source /usr/share/Modules/init/zsh else echo "Cannot switch to Modules $swname version, command not found" return 1 fi } if [ "$MODULES_USE_COMPAT_VERSION" != '1' ]; then # setup FPATH to put module completion at hand in case zsh completion enabled if [[ ! ":$FPATH:" =~ ':/usr/share/Modules/init/zsh-functions:' ]]; then FPATH=/usr/share/Modules/init/zsh-functions${FPATH:+:}$FPATH export FPATH fi # no completion support on compat version elif typeset -f compdef >/dev/null; then compdef -d module fi if [[ ! ":$PATH:" =~ ':/usr/share/Modules/bin:' ]]; then PATH=/usr/share/Modules/bin${PATH:+:}$PATH export PATH fi # initialize MANPATH if empty (zsh defines MANPATH empty by default) with a # value that preserves manpath system configuration even after addition of # paths to this variable by modulefiles if [ ! -n "${MANPATH:+x}" ]; then MANPATH=: export MANPATH fi if [[ ! ":`manpath 2>/dev/null`:" =~ ':/usr/share/man:' ]]; then if [ "$MANPATH" = ':' ] || [ "$MANPATH" = '' ]; then _mlpathsep='' else _mlpathsep=: fi MANPATH=/usr/share/man$_mlpathsep$MANPATH export MANPATH unset _mlpathsep fi fi unset _mlcode _mlret # restore shell debugging options if disabled if [ -n "${_mlshdbg:-}" ]; then set -$_mlshdbg; unset _mlshdbg; fi; fish_completion 0000644 00000022657 15152714332 0007670 0 ustar 00 #completion for modules function __fish_module_no_subcommand --description 'Test if modulecmd has yet to be given the subcommand' for i in (commandline -opc) if contains -- $i add load rm remove del unload swap switch show display list avail is-loaded is-saved is-used is-avail info-loaded aliases use unuse refresh reload purge source whatis apropos keyword search test save restore saverm saveshow savelist initadd initprepend initrm initswitch initlist initclear path paths append-path prepend-path remove-path clear config return 1 end end return 0 end function __fish_module_use_avail --description 'Test if module command should have available packages as potential completion' for i in (commandline -opc) if contains -- $i help add load swap switch show display avail is-loaded is-avail info-loaded whatis test initadd initprepend path paths return 0 end end return 1 end function __fish_module_use_list --description 'Test if module command should have loaded packages as potential completion' for i in (commandline -opc) if contains -- $i swap switch rm remove del unload return 0 end end return 1 end function __fish_module_use_initlist --description 'Test if module command should have packages in init file as potential completion' for i in (commandline -opc) if contains -- $i initrm initswitch return 0 end end return 1 end function __fish_module_use_savelist --description 'Test if module command should have saved collections as potential completion' for i in (commandline -opc) if contains -- $i save restore saverm saveshow savelist is-saved return 0 end end return 1 end function __fish_module_use_config --description 'Test if module command should have configuration parameters as potential completion' for i in (commandline -opc) if contains -- $i config return 0 end end return 1 end complete -c module -n '__fish_module_use_avail' -f -a "(module avail --color=never -s -t -S --no-indepth (commandline -ct) 2>&1 | sed '\ /^-\+/d; /^\s*\$/d; \ /->.*\$/d; \ /:\$/d; \ /:ERROR:/d; \ s#^\(.*\)/\(.\+\)(.*default.*)#\1\n\1\/\2#; \ s#(.*)\$##g; \ s#\s*\$##g;')" complete -c module -n '__fish_module_use_list' -f -a "(module list --color=never -s -t 2>&1 | sed '\ /No Modulefiles Currently Loaded\.\$/d; \ /Currently Loaded Modulefiles:\$/d;')" complete -c module -n '__fish_module_use_initlist' -f -a "(module initlist --color=never -s 2>&1 | sed '\ / loads modules:\$/d;')" complete -c module -n '__fish_module_use_savelist' -f -a "(module savelist --color=never -s -t 2>&1 | sed '\ /No named collection\.\$/d; \ /Named collection list\$/d; \ /:\$/d; \ /:ERROR:/d;')" complete -c module -n '__fish_module_use_config' -f -a "--dump-state --reset advanced_version_spec auto_handling avail_indepth collection_pin_version collection_target color colors contact extended_default extra_siteconfig home icase implicit_default locked_configs ml pager rcfile run_quarantine search_match set_shell_startup silent_shell_debug term_background unload_match_order verbosity wa_277" complete -f -n '__fish_module_no_subcommand' -c module -a 'help' --description 'Print this or modulefile(s) help info' complete -f -n '__fish_module_no_subcommand' -c module -a 'avail' --description 'List all or matching available modules' complete -f -n '__fish_module_no_subcommand' -c module -a 'is-avail' --description 'Is any of the modulefile(s) available' complete -f -n '__fish_module_no_subcommand' -c module -a 'add load' --description 'Load modulefile(s)' complete -f -n '__fish_module_no_subcommand' -c module -a 'rm remove del unload' --description 'Remove modulefile(s)' complete -f -n '__fish_module_no_subcommand' -c module -a 'swap switch' --description 'Unload mod1 and load mod2' complete -f -n '__fish_module_no_subcommand' -c module -a 'show display' --description 'Display information about modulefile(s)' complete -f -n '__fish_module_no_subcommand' -c module -a 'list' --description 'List loaded modules' complete -f -n '__fish_module_no_subcommand' -c module -a 'is-loaded' --description 'Test if any of the modulefile(s) are loaded' complete -f -n '__fish_module_no_subcommand' -c module -a 'info-loaded' --description 'Get full name of matching loaded module(s)' complete -f -n '__fish_module_no_subcommand' -c module -a 'aliases' --description 'List all module aliases' complete -f -n '__fish_module_no_subcommand' -c module -a 'use' --description 'Add dir(s) to MODULEPATH variable' complete -f -n '__fish_module_no_subcommand' -c module -a 'unuse' --description 'Remove dir(s) from MODULEPATH variable' complete -f -n '__fish_module_no_subcommand' -c module -a 'is-used' --description 'Is any of the dir(s) enabled in MODULEPATH' complete -f -n '__fish_module_no_subcommand' -c module -a 'refresh reload' --description 'Unload then load all loaded modulefiles' complete -f -n '__fish_module_no_subcommand' -c module -a 'purge' --description 'Unload all loaded modulefiles' complete -f -n '__fish_module_no_subcommand' -c module -a 'source' --description 'Execute scriptfile(s)' complete -f -n '__fish_module_no_subcommand' -c module -a 'whatis' --description 'Print whatis information of modulefile(s)' complete -f -n '__fish_module_no_subcommand' -c module -a 'apropos keyword search' --description 'Search all name and whatis containing str' complete -f -n '__fish_module_no_subcommand' -c module -a 'test' --description 'Test modulefile(s)' complete -f -n '__fish_module_no_subcommand' -c module -a 'save' --description 'Save current module list to collection' complete -f -n '__fish_module_no_subcommand' -c module -a 'restore' --description 'Restore module list from collection or file' complete -f -n '__fish_module_no_subcommand' -c module -a 'saverm' --description 'Remove saved collection' complete -f -n '__fish_module_no_subcommand' -c module -a 'saveshow' --description 'Display information about collection' complete -f -n '__fish_module_no_subcommand' -c module -a 'savelist' --description 'List all saved collections' complete -f -n '__fish_module_no_subcommand' -c module -a 'is-saved' --description 'Test if any of the collection(s) exists' complete -f -n '__fish_module_no_subcommand' -c module -a 'initadd' --description 'Add modulefile to shell init file' complete -f -n '__fish_module_no_subcommand' -c module -a 'initprepend' --description 'Add to beginning of list in init file' complete -f -n '__fish_module_no_subcommand' -c module -a 'initrm' --description 'Remove modulefile from shell init file' complete -f -n '__fish_module_no_subcommand' -c module -a 'initswitch' --description 'Switch mod1 with mod2 from init file' complete -f -n '__fish_module_no_subcommand' -c module -a 'initlist' --description 'List all modules loaded from init file' complete -f -n '__fish_module_no_subcommand' -c module -a 'initclear' --description 'Clear all modulefiles from init file' complete -f -n '__fish_module_no_subcommand' -c module -a 'path' --description 'Print modulefile path' complete -f -n '__fish_module_no_subcommand' -c module -a 'paths' --description 'Print path of matching available modules' complete -f -n '__fish_module_no_subcommand' -c module -a 'append-path' --description 'Append value to environment variable' complete -f -n '__fish_module_no_subcommand' -c module -a 'prepend-path' --description 'Prepend value to environment variable' complete -f -n '__fish_module_no_subcommand' -c module -a 'remove-path' --description 'Remove value from environment variable' complete -f -n '__fish_module_no_subcommand' -c module -a 'clear' --description 'Reset Modules-specific runtime information' complete -f -n '__fish_module_no_subcommand' -c module -a 'config' --description 'Display or set Modules configuration' complete -c module -s V -l version --description 'Module version' complete -c module -s D -l debug --description 'Enable debug messages' complete -c module -s v -l verbose --description 'Enable verbose messages' complete -c module -s s -l silent --description 'Turn off error, warning and informational messages' complete -c module -s i -l icase --description 'Case insensitive match' complete -c module -s t -l terse --description 'Display output in terse format' complete -c module -s l -l long --description 'Display output in long format' complete -c module -s j -l json --description 'Display output in JSON format' complete -c module -s d -l default --description 'Only show default versions available' complete -c module -s L -l latest --description 'Only show latest versions available' complete -c module -s S -l starts-with --description 'Search modules whose name begins with query string' complete -c module -s C -l contains --description 'Search modules whose name contains query string' complete -c module -l indepth --description 'Perform recursive avail search' complete -c module -l no-indepth --description 'Perform non-recursive avail search' complete -c module -l paginate --description 'Pipe mesg output into a pager if stream attached to terminal' complete -c module -l no-pager --description 'Do not pipe message output into a pager' complete -c module -l auto --description 'Enable automated module handling mode' complete -c module -l no-auto --description 'Disable automated module handling mode' complete -c module -s f -l force --description 'By-pass dependency consistency or confirmation dialog' complete -c module -l color --description 'Colorize the output' complete -c module -l color= --description 'Colorize the output' tcsh 0000644 00000007450 15152714332 0005441 0 ustar 00 # define module command and surrounding initial environment (default value # for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files) eval "`/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl tcsh autoinit`" # no environment alteration if the above autoinit command failed if ( $status == 0 ) then # clarify compat version is not enabled for below tests if ( ! $?MODULES_USE_COMPAT_VERSION ) then setenv MODULES_USE_COMPAT_VERSION 0 endif # redefine module command if compat version has been activated if ( "$MODULES_USE_COMPAT_VERSION" == '1' ) then setenv MODULES_CMD /usr/share/Modules/libexec/modulecmd-compat ; if ( $?histchars && $?prompt ) alias module 'set _histchars = $histchars; unset histchars; set _prompt=$prompt:q; set prompt=""; eval `/usr/share/Modules/libexec/modulecmd-compat tcsh \!*`; set _exit="$status"; set histchars = $_histchars; unset _histchars; set prompt=$_prompt:q; unset _prompt; test 0 = $_exit' ; if ( $?histchars && ! $?prompt ) alias module 'set _histchars = $histchars; unset histchars; eval `/usr/share/Modules/libexec/modulecmd-compat tcsh \!*`; set _exit="$status"; set histchars = $_histchars; unset _histchars; test 0 = $_exit' ; if ( ! $?histchars && $?prompt ) alias module 'set _prompt=$prompt:q; set prompt=""; eval `/usr/share/Modules/libexec/modulecmd-compat tcsh \!*`; set _exit="$status"; set prompt=$_prompt:q;unset _prompt; test 0 = $_exit' ; if ( ! $?histchars && ! $?prompt ) alias module 'eval `/usr/share/Modules/libexec/modulecmd-compat tcsh \!*`' ; endif # define function to switch between C and Tcl versions of Modules set switchml_defined="`alias switchml`" if ( "$switchml_defined" == '' ) then alias switchml 'set swfound=1; \\ if ( ! $?MODULES_USE_COMPAT_VERSION ) setenv MODULES_USE_COMPAT_VERSION 0; \\ if ( "$MODULES_USE_COMPAT_VERSION" == "1" ) set swname="main"; \\ if ( "$MODULES_USE_COMPAT_VERSION" == "1" && -e /usr/share/Modules/libexec/modulecmd.tcl ) set swfound=0; \\ if ( "$MODULES_USE_COMPAT_VERSION" != "1" ) set swname="compatibility"; \\ if ( "$MODULES_USE_COMPAT_VERSION" != "1" && -e /usr/share/Modules/libexec/modulecmd-compat ) set swfound=0; \\ if ( $swfound == 0 && $swname == "main" ) setenv MODULES_USE_COMPAT_VERSION 0; \\ if ( $swfound == 0 && $swname == "compatibility" ) setenv MODULES_USE_COMPAT_VERSION 1; \\ if ( $swfound == 0 ) echo "Switching to Modules $swname version"; \\ if ( $swfound == 0 ) source /usr/share/Modules/init/tcsh; \\ if ( $swfound != 0 ) echo "Cannot switch to Modules $swname version, command not found"; \\ unset swfound swname;' endif unset switchml_defined if ( $?tcsh && $?prompt && -r /usr/share/Modules/init/tcsh_completion ) then if ( "$MODULES_USE_COMPAT_VERSION" != '1' ) then source /usr/share/Modules/init/tcsh_completion else # no completion support on compat version uncomplete module endif endif if ( ":${PATH}:" !~ '*:/usr/share/Modules/bin:*' ) then if ( "$PATH" == '' ) then setenv PATH /usr/share/Modules/bin else setenv PATH "/usr/share/Modules/bin:$PATH" endif endif if ( $?MANPATH ) then set manpath = $MANPATH else set manpath = `manpath` # initialize MANPATH if not set with a value that preserves manpath # system configuration even after addition of paths to this variable # by modulefiles setenv MANPATH : endif if ( ":${manpath}:" !~ '*:/usr/share/man:*' ) then if ( "$MANPATH" == '' || "$MANPATH" == ':' ) then set mlpathsep = '' else set mlpathsep = : endif setenv MANPATH "/usr/share/man$mlpathsep$MANPATH" unset mlpathsep endif unset manpath endif ksh 0000644 00000010102 15152714332 0005251 0 ustar 00 unset _mlshdbg; # disable shell debugging for the run of this init file if [ "${MODULES_SILENT_SHELL_DEBUG:-0}" = '1' ]; then # immediately disable debugging to echo the less number of line possible case "$-" in *v*x*) set +vx; _mlshdbg='vx' ;; *v*) set +v; _mlshdbg='v' ;; *x*) set +x; _mlshdbg='x' ;; *) _mlshdbg='' ;; esac; fi; # define modules runtine quarantine configuration export MODULES_RUN_QUARANTINE='LD_LIBRARY_PATH LD_PRELOAD' # setup quarantine if defined unset _mlre _mlIFS; if [ -n "${IFS+x}" ]; then _mlIFS=$IFS; fi; IFS=' '; for _mlv in ${MODULES_RUN_QUARANTINE:-}; do if [ "${_mlv}" = "${_mlv##*[!A-Za-z0-9_]}" -a "${_mlv}" = "${_mlv#[0-9]}" ]; then if [ -n "`eval 'echo ${'$_mlv'+x}'`" ]; then _mlre="${_mlre:-}${_mlv}_modquar='`eval 'echo ${'$_mlv'}'`' "; fi; _mlrv="MODULES_RUNENV_${_mlv}"; _mlre="${_mlre:-}${_mlv}='`eval 'echo ${'$_mlrv':-}'`' "; fi; done; if [ -n "${_mlre:-}" ]; then _mlre="eval ${_mlre}"; fi; # define module command and surrounding initial environment (default value # for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files) _mlcode=`${_mlre:-}/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl ksh autoinit` _mlret=$? # clean temp variables used to setup quarantine if [ -n "${_mlIFS+x}" ]; then IFS=$_mlIFS; unset _mlIFS; else unset IFS; fi; unset _mlre _mlv _mlrv # no environment alteration if the above autoinit command failed if [ $_mlret -eq 0 ]; then eval "$_mlcode" # redefine module command if compat version has been activated if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then MODULES_CMD=/usr/share/Modules/libexec/modulecmd-compat export MODULES_CMD if [ -t 2 ]; then _module_raw() { eval `/usr/share/Modules/libexec/modulecmd-compat ksh $*`; } else module() { eval `/usr/share/Modules/libexec/modulecmd-compat ksh $*`; } fi fi # define function to switch between C and Tcl versions of Modules switchml() { typeset swfound=1 if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then typeset swname='main' if [ -e /usr/share/Modules/libexec/modulecmd.tcl ]; then typeset swfound=0 unset MODULES_USE_COMPAT_VERSION fi else typeset swname='compatibility' if [ -e /usr/share/Modules/libexec/modulecmd-compat ]; then typeset swfound=0 MODULES_USE_COMPAT_VERSION=1 export MODULES_USE_COMPAT_VERSION fi fi # switch version only if command found if [ $swfound -eq 0 ]; then echo "Switching to Modules $swname version" . /usr/share/Modules/init/ksh else echo "Cannot switch to Modules $swname version, command not found" return 1 fi } # setup FPATH to get module defined in 'ksh' interactive and non-interactive # sub-shells. only set in ksh init script to avoid side effect default FPATH # set for 'zsh' shell when it starts. _mlinstr=":$FPATH:" if [ "${_mlinstr#*:/usr/share/Modules/init/ksh-functions:}" = "$_mlinstr" ]; then FPATH=$FPATH${FPATH:+:}/usr/share/Modules/init/ksh-functions export FPATH fi _mlinstr=":$PATH:" if [ "${_mlinstr#*:/usr/share/Modules/bin:}" = "$_mlinstr" ]; then PATH=/usr/share/Modules/bin${PATH:+:}$PATH export PATH fi # initialize MANPATH if not set with a value that preserves manpath system # configuration even after addition of paths to this variable by modulefiles if [ ! -n "${MANPATH+x}" ]; then MANPATH=: export MANPATH fi _mlinstr=":`manpath 2>/dev/null`:" if [ "${_mlinstr#*:/usr/share/man:}" = "$_mlinstr" ]; then if [ "$MANPATH" = ':' ] || [ "$MANPATH" = '' ]; then _mlpathsep='' else _mlpathsep=: fi MANPATH=/usr/share/man$_mlpathsep$MANPATH export MANPATH unset _mlpathsep fi unset _mlinstr fi unset _mlcode _mlret # restore shell debugging options if disabled if [ -n "${_mlshdbg:-}" ]; then set -$_mlshdbg; unset _mlshdbg; fi; fish 0000644 00000003305 15152714332 0005424 0 ustar 00 # define modules runtine quarantine configuration set -xg MODULES_RUN_QUARANTINE 'LD_LIBRARY_PATH LD_PRELOAD' # 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 config files) eval $_mlre /usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl fish autoinit | source - # no environment alteration if the above autoinit command failed if [ $status -eq 0 ] if status -i if [ -r /usr/share/Modules/init/fish_completion ] source /usr/share/Modules/init/fish_completion end end # no switchml definition since there is no Fish support in C version if not contains /usr/share/Modules/bin $PATH set -xg PATH /usr/share/Modules/bin $PATH end # initialize MANPATH if not set with a value that preserves manpath system # configuration even after addition of paths to this variable by modulefiles if not set -q MANPATH set -xg MANPATH : end if not string match -q '*:/usr/share/man:*' :(manpath ^/dev/null): if [ -z "$MANPATH" -o "$MANPATH" = ':' ] set _mlpathsep '' else set _mlpathsep : end set -xg MANPATH /usr/share/man$_mlpathsep$MANPATH set -e _mlpathsep end end # clean temp variables used to setup quarantine set -e _mlre; set -e _mlv; set -e _mlrv; cmake 0000644 00000003605 15152714333 0005557 0 ustar 00 # define modules runtine quarantine configuration set(ENV{MODULES_RUN_QUARANTINE} "LD_LIBRARY_PATH LD_PRELOAD") # setup quarantine if defined set(_mlre "") if(DEFINED ENV{MODULES_RUN_QUARANTINE}) string(REPLACE " " ";" _mlv_list "$ENV{MODULES_RUN_QUARANTINE}") foreach(_mlv ${_mlv_list}) if(${_mlv} MATCHES "^[A-Za-z_][A-Za-z0-9_]*$") if(DEFINED ENV{${_mlv}}) set(_mlre "${_mlre}${_mlv}_modquar=$ENV{${_mlv}};") endif() set(_mlrv "MODULES_RUNENV_${_mlv}") set(_mlre "${_mlre}${_mlv}=$ENV{${_mlrv}};") endif() endforeach() if (NOT "${_mlre}" STREQUAL "") set(_mlre "env;${_mlre}") endif() endif() # define module command and surrounding initial environment (default value # for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files) execute_process(COMMAND mktemp -t moduleinit.cmake.XXXXXXXXXXXX OUTPUT_VARIABLE tempfile_name OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${_mlre} /usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl cmake autoinit OUTPUT_FILE ${tempfile_name}) if(EXISTS ${tempfile_name}) include(${tempfile_name}) file(REMOVE ${tempfile_name}) endif() # redefine module command if compat version has been activated if("$ENV{MODULES_USE_COMPAT_VERSION}" STREQUAL "1") set(ENV{MODULES_CMD} "/usr/share/Modules/libexec/modulecmd-compat") function(module) execute_process(COMMAND mktemp -t moduleinit.cmake.XXXXXXXXXXXX OUTPUT_VARIABLE tempfile_name OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND /usr/share/Modules/libexec/modulecmd-compat cmake ${ARGV} OUTPUT_FILE ${tempfile_name}) if(EXISTS ${tempfile_name}) include(${tempfile_name}) file(REMOVE ${tempfile_name}) endif() # return value as done on new main version set(module_result TRUE PARENT_SCOPE) endfunction(module) endif() zsh-functions/_module 0000644 00000026143 15152714333 0010737 0 ustar 00 #compdef module # # Zsh command-line completion for module # Copyright (C) 2017 Xavier Delaruelle <xavier.delaruelle@cea.fr> # _module_avail() { local cur="${1:-}"; # skip avail call if word currently being completed is an option keyword if [ -z "$cur" -o "${cur:0:1}" != '-' ]; then module avail --color=never -s -t -S --no-indepth $cur 2>&1 | sed ' /^-\+/d; /^\s*$/d; /->.*$/d; /:$/d; s#^\(.*\)/\(.\+\)(.*default.*)#\1\n\1\/\2#; s#(.*)$##g; s#\s*$##g;' fi } _module_savelist() { module savelist --color=never -s -t 2>&1 | sed ' /No named collection\.$/d; /Named collection list$/d; /:$/d;' } _module_not_yet_loaded() { _module_avail ${1:-} | sort | sed -E "\%^(${LOADEDMODULES//:/|})$%d" } _module_avail_mods() { local -a avail_mods; local suffix=' '; avail_mods=(${$(_module_avail $cur ${1:-})}) # do not append space to word completed if it is a directory (ends with /) for val in $avail_mods; do if [ "${val: -1:1}" = '/' ]; then suffix='' break fi done compadd -S "$suffix" -a avail_mods && ret=0 } _module_saved_colls() { local -a saved_colls; saved_colls=(${$(_module_savelist)}) _describe -t saved-colls 'saved collections' saved_colls && ret=0 } _module_notloaded_mods() { local -a not_yet_loaded_mods; local suffix=' '; not_yet_loaded_mods=(${$(_module_not_yet_loaded ${1:-})}) # do not append space to word completed if it is a directory (ends with /) for val in $not_yet_loaded_mods; do if [ "${val: -1:1}" = '/' ]; then suffix='' break fi done compadd -S "$suffix" -a not_yet_loaded_mods && ret=0 } _module_loaded_mods() { local -a loaded_mods; loaded_mods=(${=LOADEDMODULES//:/ }) _describe -t loaded-mods 'loaded modulefiles' loaded_mods && ret=0 } _module_used_paths() { local -a used_paths; used_paths=(${=MODULEPATH//:/ }) _describe -t used-paths 'enabled modulepaths' used_paths && ret=0 } _module() { typeset -A opt_args _arguments -C \ '(-D --debug)'{-D,--debug}'[Enable debug messages]' \ '(-v --verbose)'{-v,--verbose}'[Enable verbose messages]' \ '(-s --silent)'{-s,--silent}'[Turn off error, warning and informational messages]' \ '(-h --help)'{-h,--help}'[Usage info]' \ '(-V --version)'{-V,--version}'[Module version]' \ '--paginate[Pipe mesg output into a pager if stream attached to terminal]' \ '--no-pager[Do not pipe message output into a pager]' \ '(--color --color=)'{--color,--color=}'[Colorize the output]' \ '(-): :->cmd' \ '(-)*:: :->arg' && ret=0 case $state in (cmd) local -a cmds; cmds=( 'add:Load modulefile(s)' 'load:Load modulefile(s)' 'rm:Remove modulefile(s)' 'remove:Remove modulefile(s)' 'del:Remove modulefile(s)' 'unload:Remove modulefile(s)' 'purge:Unload all loaded modulefiles' 'reload:Unload then load all loaded modulefiles' 'refresh:Unload then load all loaded modulefiles' 'switch:Unload mod1 and load mod2' 'swap:Unload mod1 and load mod2' 'list:List loaded modules' 'avail:List all or matching available modules' 'is-avail:Is any of the modulefile(s) available' 'is-loaded:Test if any of the modulefile(s) are loaded' 'info-loaded:Get full name of matching loaded module(s)' 'aliases:List all module aliases' 'whatis:Print whatis information of modulefile(s)' 'apropos:Search all name and whatis containing str' 'keyword:Search all name and whatis containing str' 'search:Search all name and whatis containing str' 'save:Save current module list to collection' 'restore:Restore module list from collection or file' 'saverm:Remove saved collection' 'saveshow:Display information about collection' 'savelist:List all saved collections' 'is-saved:Test if any of the collection(s) exists' 'initlist:List all modules loaded from init file' 'initadd:Add modulefile to shell init file' 'initrm:Remove modulefile from shell init file' 'initprepend:Add to beginning of list in init file' 'initswitch:Switch mod1 with mod2 from init file' 'initclear:Clear all modulefiles from init file' 'help:Print this or modulefile(s) help info' 'display:Display information about modulefile(s)' 'show:Display information about modulefile(s)' 'test:Test modulefile(s)' 'use:Add dir(s) to MODULEPATH variable' 'unuse:Remove dir(s) from MODULEPATH variable' 'is-used:Is any of the dir(s) enabled in MODULEPATH' 'path:Print modulefile path' 'paths:Print path of matching available modules' 'source:Execute scriptfile(s)' 'append-path:Append value to environment variable' 'prepend-path:Prepend value to environment variable' 'remove-path:Remove value from environment variable' 'clear:Reset Modules-specific runtime information' 'config:Display or set Modules configuration' ) # show commands only with compatible options if (( !$+opt_args[-h] && !$+opt_args[--help] \ && !$+opt_args[-V] && !$+opt_args[--version] )); then _describe -t cmds 'Module Sub-Commands' cmds && ret=0 fi ;; (arg) local cmd="${words[1]}" local cur="${words[CURRENT]}" case $cmd in (load|add) _arguments \ '--auto[Enable automated module handling mode]' \ '--no-auto[Disable automated module handling mode]' \ '(-f --force)'{-f,--force}'[By-pass dependency consistency]' \ '(-i --icase)'{-i,--icase}'[Case insensitive match]' \ "*::modulefile:{_module_notloaded_mods $cur}" && ret=0 ;; (avail) _arguments \ '(-l --long)'{-l,--long}'[Display output in long format]' \ '(-t --terse)'{-t,--terse}'[Display output in terse format]' \ '(-j --json)'{-j,--json}'[Display output in JSON format]' \ '(-d --default)'{-d,--default}'[Only show default versions available]' \ '(-L --latest)'{-L,--latest}'[Only show latest versions available]' \ '(-i --icase)'{-i,--icase}'[Case insensitive match]' \ '(-S --starts-with)'{-S,--starts-with}'[Search modules whose name begins with query string]' \ '(-C --contains)'{-C,--contains}'[Search modules whose name contains query string]' \ '--indepth[Perform recursive avail search]' \ '--no-indepth[Perform non-recursive avail search]' \ "*::modulefile:{_module_avail_mods $cur}" && ret=0 ;; (list|savelist) local -a opts; opts=( '-l:Display output in long format' '--long:Display output in long format' '-t:Display output in terse format' '--terse:Display output in terse format' '-j:Display output in JSON format' '--json:Display output in JSON format' ) _describe -t opts 'Switches' opts && ret=0 ;; (clear) _arguments \ '(-f --force)'{-f,--force}'[Skip confirmation dialog]' && ret=0 ;; (restore|save|saveshow|saverm|is-saved) _alternative 'avail-colls:collections:{_module_saved_colls}' \ && ret=0 ;; (rm|del|remove|unload) _arguments \ '--auto[Enable automated module handling mode]' \ '--no-auto[Disable automated module handling mode]' \ '(-f --force)'{-f,--force}'[By-pass dependency consistency]' \ '(-i --icase)'{-i,--icase}'[Case insensitive match]' \ '*::modulefile:_module_loaded_mods' && ret=0 ;; (switch|swap) _arguments \ '--auto[Enable automated module handling mode]' \ '--no-auto[Disable automated module handling mode]' \ '(-f --force)'{-f,--force}'[By-pass dependency consistency]' \ '(-i --icase)'{-i,--icase}'[Case insensitive match]' \ '1:loaded modulefile:_module_loaded_mods' \ "2:modulefile:{_module_notloaded_mods $cur}" && ret=0 ;; (unuse|is-used) _alternative 'used-paths:modulepaths:{_module_used_paths}' \ && ret=0 ;; (use) _arguments \ '(-a --append)'{-a,--append}'[Append directory to MODULEPATH]' \ '(-p --prepend)'{-p,--prepend}'[Prepend directory to MODULEPATH]' \ '*:modulepath:_files -/' && ret=0 ;; (display|help|show|test|path|paths|is-loaded|is-avail|info-loaded) _arguments \ '(-i --icase)'{-i,--icase}'[Case insensitive match]' \ "*::modulefile:{_module_avail_mods $cur}" && ret=0 ;; (whatis) _arguments \ '(-i --icase)'{-i,--icase}'[Case insensitive match]' \ '(-j --json)'{-j,--json}'[Display output in JSON format]' \ "*::modulefile:{_module_avail_mods $cur}" && ret=0 ;; (apropos|keyword|search) _arguments \ '(-j --json)'{-j,--json}'[Display output in JSON format]' \ && ret=0 ;; (append-path|prepend-path) _arguments \ '(-d --delim)'{-d,--delim}'[Path element separator]' \ '--duplicates[Duplicate existing element]' \ && ret=0 ;; (remove-path) _arguments \ '(-d --delim)'{-d,--delim}'[Path element separator]' \ '--index[Remove path element with index]' \ && ret=0 ;; (config) _arguments \ '--dump-state[Report each state value of current Modules execution]' \ '--reset[Unset environment variable relative to configuration key]' \ '1:configuration key:(advanced_version_spec auto_handling avail_indepth collection_pin_version collection_target color colors contact extended_default extra_siteconfig home icase implicit_default locked_configs ml pager rcfile run_quarantine search_match set_shell_startup silent_shell_debug term_background unload_match_order verbosity wa_277)' \ && ret=0 ;; esac ;; esac } _module "$@" # vim:set tabstop=3 shiftwidth=3 expandtab autoindent: lisp 0000644 00000006236 15152714333 0005451 0 ustar 00 ;; ;; emacs-lisp init code for Modules ;; (setenv "MODULESHOME" "/usr/share/Modules") (defvar Modules-history '() "module cmd history list") (defun Modules-module (command) "Run the string COMMAND as a Modules cmd using the tcl version of modules. Any resulting output is placed in buffer \" *modules-cmd*\". This should consist of a single line, a filename, which is expected to contain Emacs lisp code to implement the indicated module commands. The lisp code in this file is eval'd by Emacs on successful completion of modulecmd.tcl. Standard error output is placed in buffer \" *module-log*\" which will be displayed if not empty. Return value is t on success, nil otherwise." (interactive (list (read-string "Module cmd: " nil 'Modules-history))) (let ((cmd-buffer (get-buffer-create " *modules-cmd*")) (log-buffer (get-buffer-create " *modules-log*")) (log-scratch-file (make-temp-name (expand-file-name "modules-log" (if (fboundp 'temp-directory) (temp-directory) ;; XEmacs temporary-file-directory)))) (status nil)) ;; clear cmd buffer, log buffer is replaced below (set-buffer cmd-buffer) (delete-region (point-min) (point-max)) (if (condition-case nil ;; call-process on Emacs cannot write stderr to a separate buffer ;; so it must go to a file and then get pulled into the log buffer ;; (XEmacs *can* direct stderr to buffer, but not worth special case) (progn (apply 'call-process "/usr/bin/tclsh" nil (list cmd-buffer log-scratch-file) nil ;; don't display stdout "/usr/share/Modules/libexec/modulecmd.tcl" "lisp" (split-string command)) t) (error nil)) (progn ;; pull any log info from log-scratch-file into log-buffer (set-buffer log-buffer) (insert-file-contents log-scratch-file nil nil nil t) ;; display any output written to stderr ( eg: module help|list ) (if (> (buffer-size) 0) (switch-to-buffer-other-window log-buffer)) ;; Run any setenv, etc commands produced by modulecmd.tcl ;; cmd-buffer should currently contain the pathname of file to run ;; Note: use eval-buffer instead of load-file to avoid stomping ;; any (message) output from the script itself. (set-buffer cmd-buffer) (if (> (buffer-size) 0) (progn ;; run it carefully. If an error is thrown, catch it and ;; propagate the fact upwards as a nil, but be sure to still ;; execute cleanup below (setq status (condition-case nil (progn (eval-buffer) t) (error nil))))))) ;; all done, clean up (delete-file log-scratch-file) status)) ruby.rb 0000644 00000002543 15152714334 0006063 0 ustar 00 # define modules runtine quarantine configuration ENV['MODULES_RUN_QUARANTINE'] = 'LD_LIBRARY_PATH LD_PRELOAD' # setup quarantine if defined _mlre = '' if ENV.has_key?('MODULES_RUN_QUARANTINE') then ENV['MODULES_RUN_QUARANTINE'].split(' ').each do |_mlv| if _mlv =~ /^[A-Za-z_][A-Za-z0-9_]*$/ then if ENV.has_key?(_mlv) then _mlre << _mlv + "_modquar='" + ENV[_mlv].to_s + "' " end _mlrv = 'MODULES_RUNENV_' + _mlv _mlre << _mlv + "='" + ENV[_mlrv].to_s + "' " end end unless _mlre.empty? _mlre = 'env ' + _mlre end end # define module command and surrounding initial environment (default value # for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files) eval `#{_mlre}/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl ruby autoinit` # redefine module command if compat version has been activated if ENV['MODULES_USE_COMPAT_VERSION'] == '1' then ENV['MODULES_CMD'] = '/usr/share/Modules/libexec/modulecmd-compat' class ENVModule def ENVModule.module(*args) if args[0].kind_of?(Array) then args = args[0].join(' ') else args = args.join(' ') end eval `/usr/share/Modules/libexec/modulecmd-compat ruby #{args}` # return value as done on new main version return true end end end bash_completion 0000644 00000026310 15152714334 0007644 0 ustar 00 # # Bash commandline completion # _module_comgen_words_and_files() { local k=0 local setnospace=1 # do not append space to word completed if it is a directory (ends with /) for val in $(compgen -W "$1" -- "$2"); do if [ !$setnospace -a "${val: -1:1}" = '/' ]; then # Bash >=4.0 is required for compopt type compopt &>/dev/null && compopt -o nospace setnospace=0 fi COMPREPLY[k++]="$val" done } _module_avail() { local cur="${1:-}" # skip avail call if word currently being completed is an option keyword if [ -z "$cur" -o "${cur:0:1}" != '-' ]; then module avail --color=never -s -t -S --no-indepth $cur 2>&1 | sed ' /^-\+/d; /^\s*$/d; /->.*$/d; /:$/d; s#^\(.*\)/\(.\+\)(.*default.*)#\1\n\1\/\2#; s#(.*)$##g; s#\s*$##g;' fi } _module_savelist() { module savelist --color=never -s -t 2>&1 | sed ' /No named collection\.$/d; /Named collection list$/d; /:$/d;' } _module_not_yet_loaded() { _module_avail ${1:-} | sort | sed -E "\%^(${LOADEDMODULES//:/|})$%d" } _module_long_arg_list() { local cur="$1" i if [[ ${COMP_WORDS[COMP_CWORD-2]} == sw* ]] then _module_comgen_words_and_files "$(_module_not_yet_loaded $cur)" "$cur" return fi for ((i = COMP_CWORD - 1; i > 0; i--)) do case ${COMP_WORDS[$i]} in add|load) _module_comgen_words_and_files "$(_module_not_yet_loaded $cur)" "$cur" break;; rm|del|remove|unload|switch|swap) COMPREPLY=( $(IFS=: compgen -W "${LOADEDMODULES}" -- "$cur") ) break;; esac done } # define completion relative to active version if [ "$MODULES_USE_COMPAT_VERSION" = '1' ]; then _module() { local cur="$2" prev="$3" cmds opts COMPREPLY=() cmds="add apropos avail clear display del help\ initadd initclear initlist initprepend initrm initswitch\ keyword list load purge refresh remove rm show swap switch\ unload unuse update use whatis" opts="-c -f -h -i -l -s -t -u -v -H -V\ --create --force --help --human --icase\ --long --silent --terse --userlvl --verbose --version" case "$prev" in add|load) COMPREPLY=( $(compgen -W "$(_module_not_yet_loaded)" -- "$cur") );; rm|del|remove|unload|switch|swap) COMPREPLY=( $(IFS=: compgen -W "${LOADEDMODULES}" -- "$cur") );; unuse) COMPREPLY=( $(IFS=: compgen -W "${MODULEPATH}" -- "$cur") );; use|*-a*) ;; # let readline handle the completion -u|--userlvl) COMPREPLY=( $(compgen -W "novice expert advanced" -- "$cur") );; av*|disp*|help|show|whatis) COMPREPLY=( $(compgen -W "$(_module_avail)" -- "$cur") );; *) if test $COMP_CWORD -gt 2 then _module_long_arg_list "$cur" else case "$cur" in # The mappings below are optional abbreviations for convenience ls) COMPREPLY="list";; # map ls -> list r*) COMPREPLY="rm";; # also covers 'remove' sw*) COMPREPLY="switch";; -*) COMPREPLY=( $(compgen -W "$opts" -- "$cur") );; *) COMPREPLY=( $(compgen -W "$cmds" -- "$cur") );; esac fi;; esac } else _module() { local cur="$2" prev="$3" cmds opts COMPREPLY=() cmds="add apropos aliases avail append-path clear config del display help\ initadd initclear initlist initprepend initrm is-loaded is-saved\ is-used is-avail info-loaded keyword list load path paths purge\ prepend-path refresh reload restore rm remove remove-path save\ savelist saveshow saverm search show source swap switch test unload\ unuse use whatis" opts="-D -h -s -v -V --debug --help --silent --verbose --version\ --paginate --no-pager --color --color=" load_opts="--auto --no-auto --force -f -i --icase" list_opts="-j -l -t --json --long --terse" clear_opts="--force -f" path_opts="-d --delim --duplicates" rm_path_opts="-d --delim --index" avail_opts="-C -d -j -i -L -l -S -t --contains --default --icase --json\ --latest --long --starts-with --terse --indepth --no-indepth" mfile_opts="-i --icase" search_opts="-j --json" whatis_opts="-i -j --icase --json" config_opts="--dump-state --reset advanced_version_spec auto_handling\ avail_indepth collection_pin_version collection_target color colors\ contact extended_default extra_siteconfig home icase implicit_default\ locked_configs ml pager rcfile run_quarantine search_match\ set_shell_startup silent_shell_debug term_background\ unload_match_order verbosity wa_277" case "$prev" in add|load) _module_comgen_words_and_files "$load_opts $(_module_not_yet_loaded $cur)" "$cur";; avail) _module_comgen_words_and_files "$avail_opts $(_module_avail $cur)" "$cur";; list|savelist) COMPREPLY=( $(compgen -W "$list_opts" -- "$cur") );; clear) COMPREPLY=( $(compgen -W "$clear_opts" -- "$cur") );; restore|save|saveshow|saverm|is-saved) COMPREPLY=( $(compgen -W "$(_module_savelist)" -- "$cur") );; rm|del|remove|unload|switch|swap) COMPREPLY=( $(compgen -W "$load_opts ${LOADEDMODULES//:/ }" -- "$cur") );; unuse|is-used) COMPREPLY=( $(IFS=: compgen -W "${MODULEPATH}" -- "$cur") );; use|-a|--append) ;; # let readline handle the completion display|help|show|test|path|paths|is-loaded|is-avail|info-loaded) _module_comgen_words_and_files "$mfile_opts $(_module_avail $cur)" "$cur";; whatis) _module_comgen_words_and_files "$whatis_opts $(_module_avail $cur)" "$cur";; apropos|keyword|search) COMPREPLY=( $(compgen -W "$search_opts" -- "$cur") );; config|--reset) COMPREPLY=( $(compgen -W "$config_opts" -- "$cur") );; -h|--help|-V|--version|aliases|purge|refresh|reload|source) ;; append-path|prepend-path) COMPREPLY=( $(compgen -W "$path_opts" -- "$cur") );; remove-path) COMPREPLY=( $(compgen -W "$rm_path_opts" -- "$cur") );; initadd|initclear|initlist|initprepend|initrm) ;; *) if test $COMP_CWORD -gt 2 then _module_long_arg_list "$cur" else case "$cur" in # The mappings below are optional abbreviations for convenience ls) COMPREPLY="list";; # map ls -> list sw*) COMPREPLY="switch";; -*) COMPREPLY=( $(compgen -W "$opts" -- "$cur") );; *) COMPREPLY=( $(compgen -W "$opts $cmds" -- "$cur") );; esac fi;; esac } # define completion for ml command if command exists if $(type -t ml >/dev/null); then _ml() { local cur="$2" prev="$3" cmds opts COMPREPLY=() cmds="add apropos aliases avail append-path clear config del display help\ initadd initclear initlist initprepend initrm is-loaded is-saved\ is-used is-avail info-loaded keyword list load path paths purge\ prepend-path refresh reload restore rm remove remove-path save\ savelist saveshow saverm search show source swap switch test unload\ unuse use whatis" opts="-D -h -s -v -V --debug --help --silent --verbose --version\ --paginate --no-pager --color --color=" load_opts="--auto --no-auto --force -f -i --icase" list_opts="-j -l -t --json --long --terse" clear_opts="--force -f" path_opts="-d --delim --duplicates" rm_path_opts="-d --delim --index" avail_opts="-C -d -j -i -L -l -S -t --contains --default --icase --json\ --latest --long --starts-with --terse --indepth --no-indepth" mfile_opts="-i --icase" search_opts="-j --json" whatis_opts="-i -j --icase --json" config_opts="--dump-state --reset advanced_version_spec auto_handling\ avail_indepth collection_pin_version collection_target color colors\ contact extended_default extra_siteconfig home icase implicit_default\ locked_configs ml pager rcfile run_quarantine search_match\ set_shell_startup silent_shell_debug term_background\ unload_match_order verbosity wa_277" case "$prev" in add|load) _module_comgen_words_and_files "$load_opts $(_module_not_yet_loaded $cur)" "$cur";; avail) _module_comgen_words_and_files "$avail_opts $(_module_avail $cur)" "$cur";; list|savelist) COMPREPLY=( $(compgen -W "$list_opts" -- "$cur") );; clear) COMPREPLY=( $(compgen -W "$clear_opts" -- "$cur") );; restore|save|saveshow|saverm|is-saved) COMPREPLY=( $(compgen -W "$(_module_savelist)" -- "$cur") );; rm|del|remove|unload|switch|swap) COMPREPLY=( $(compgen -W "$load_opts ${LOADEDMODULES//:/ }" -- "$cur") );; unuse|is-used) COMPREPLY=( $(IFS=: compgen -W "${MODULEPATH}" -- "$cur") );; use|-a|--append) ;; # let readline handle the completion display|help|show|test|path|paths|is-loaded|is-avail|info-loaded) _module_comgen_words_and_files "$mfile_opts $(_module_avail $cur)" "$cur";; whatis) _module_comgen_words_and_files "$whatis_opts $(_module_avail $cur)" "$cur";; apropos|keyword|search) COMPREPLY=( $(compgen -W "$search_opts" -- "$cur") );; config|--reset) COMPREPLY=( $(compgen -W "$config_opts" -- "$cur") );; -h|--help|-V|--version|aliases|purge|refresh|reload|source) ;; append-path|prepend-path) COMPREPLY=( $(compgen -W "$path_opts" -- "$cur") );; remove-path) COMPREPLY=( $(compgen -W "$rm_path_opts" -- "$cur") );; initadd|initclear|initlist|initprepend|initrm) ;; *) if test $COMP_CWORD -gt 2 then _module_long_arg_list "$cur" else case "$cur" in # The mappings below are optional abbreviations for convenience ls) COMPREPLY="list";; # map ls -> list sw*) COMPREPLY="switch";; -*) COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) loaded_modules="" for i in ${LOADEDMODULES//:/ }; do loaded_modules+="-${i} " done COMPREPLY=( "${COMPREPLY[@]}" $(compgen -W "$load_opts $loaded_modules" -- "$cur") );; *) _module_comgen_words_and_files "$load_opts $(_module_not_yet_loaded $cur)" "$cur" COMPREPLY=( "${COMPREPLY[@]}" $(compgen -W "$opts $cmds" -- "$cur") ) loaded_modules="" for i in ${LOADEDMODULES//:/ }; do loaded_modules+="-${i} " done COMPREPLY=( "${COMPREPLY[@]}" $(compgen -W "$load_opts $loaded_modules" -- "$cur") );; esac fi;; esac } complete -o default -F _ml ml fi fi complete -o default -F _module module ksh-functions/switchml 0000644 00000010102 15152714334 0011113 0 ustar 00 unset _mlshdbg; # disable shell debugging for the run of this init file if [ "${MODULES_SILENT_SHELL_DEBUG:-0}" = '1' ]; then # immediately disable debugging to echo the less number of line possible case "$-" in *v*x*) set +vx; _mlshdbg='vx' ;; *v*) set +v; _mlshdbg='v' ;; *x*) set +x; _mlshdbg='x' ;; *) _mlshdbg='' ;; esac; fi; # define modules runtine quarantine configuration export MODULES_RUN_QUARANTINE='LD_LIBRARY_PATH LD_PRELOAD' # setup quarantine if defined unset _mlre _mlIFS; if [ -n "${IFS+x}" ]; then _mlIFS=$IFS; fi; IFS=' '; for _mlv in ${MODULES_RUN_QUARANTINE:-}; do if [ "${_mlv}" = "${_mlv##*[!A-Za-z0-9_]}" -a "${_mlv}" = "${_mlv#[0-9]}" ]; then if [ -n "`eval 'echo ${'$_mlv'+x}'`" ]; then _mlre="${_mlre:-}${_mlv}_modquar='`eval 'echo ${'$_mlv'}'`' "; fi; _mlrv="MODULES_RUNENV_${_mlv}"; _mlre="${_mlre:-}${_mlv}='`eval 'echo ${'$_mlrv':-}'`' "; fi; done; if [ -n "${_mlre:-}" ]; then _mlre="eval ${_mlre}"; fi; # define module command and surrounding initial environment (default value # for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files) _mlcode=`${_mlre:-}/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl ksh autoinit` _mlret=$? # clean temp variables used to setup quarantine if [ -n "${_mlIFS+x}" ]; then IFS=$_mlIFS; unset _mlIFS; else unset IFS; fi; unset _mlre _mlv _mlrv # no environment alteration if the above autoinit command failed if [ $_mlret -eq 0 ]; then eval "$_mlcode" # redefine module command if compat version has been activated if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then MODULES_CMD=/usr/share/Modules/libexec/modulecmd-compat export MODULES_CMD if [ -t 2 ]; then _module_raw() { eval `/usr/share/Modules/libexec/modulecmd-compat ksh $*`; } else module() { eval `/usr/share/Modules/libexec/modulecmd-compat ksh $*`; } fi fi # define function to switch between C and Tcl versions of Modules switchml() { typeset swfound=1 if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then typeset swname='main' if [ -e /usr/share/Modules/libexec/modulecmd.tcl ]; then typeset swfound=0 unset MODULES_USE_COMPAT_VERSION fi else typeset swname='compatibility' if [ -e /usr/share/Modules/libexec/modulecmd-compat ]; then typeset swfound=0 MODULES_USE_COMPAT_VERSION=1 export MODULES_USE_COMPAT_VERSION fi fi # switch version only if command found if [ $swfound -eq 0 ]; then echo "Switching to Modules $swname version" . /usr/share/Modules/init/ksh else echo "Cannot switch to Modules $swname version, command not found" return 1 fi } # setup FPATH to get module defined in 'ksh' interactive and non-interactive # sub-shells. only set in ksh init script to avoid side effect default FPATH # set for 'zsh' shell when it starts. _mlinstr=":$FPATH:" if [ "${_mlinstr#*:/usr/share/Modules/init/ksh-functions:}" = "$_mlinstr" ]; then FPATH=$FPATH${FPATH:+:}/usr/share/Modules/init/ksh-functions export FPATH fi _mlinstr=":$PATH:" if [ "${_mlinstr#*:/usr/share/Modules/bin:}" = "$_mlinstr" ]; then PATH=/usr/share/Modules/bin${PATH:+:}$PATH export PATH fi # initialize MANPATH if not set with a value that preserves manpath system # configuration even after addition of paths to this variable by modulefiles if [ ! -n "${MANPATH+x}" ]; then MANPATH=: export MANPATH fi _mlinstr=":`manpath 2>/dev/null`:" if [ "${_mlinstr#*:/usr/share/man:}" = "$_mlinstr" ]; then if [ "$MANPATH" = ':' ] || [ "$MANPATH" = '' ]; then _mlpathsep='' else _mlpathsep=: fi MANPATH=/usr/share/man$_mlpathsep$MANPATH export MANPATH unset _mlpathsep fi unset _mlinstr fi unset _mlcode _mlret # restore shell debugging options if disabled if [ -n "${_mlshdbg:-}" ]; then set -$_mlshdbg; unset _mlshdbg; fi; ksh-functions/module 0000644 00000010102 15152714335 0010547 0 ustar 00 unset _mlshdbg; # disable shell debugging for the run of this init file if [ "${MODULES_SILENT_SHELL_DEBUG:-0}" = '1' ]; then # immediately disable debugging to echo the less number of line possible case "$-" in *v*x*) set +vx; _mlshdbg='vx' ;; *v*) set +v; _mlshdbg='v' ;; *x*) set +x; _mlshdbg='x' ;; *) _mlshdbg='' ;; esac; fi; # define modules runtine quarantine configuration export MODULES_RUN_QUARANTINE='LD_LIBRARY_PATH LD_PRELOAD' # setup quarantine if defined unset _mlre _mlIFS; if [ -n "${IFS+x}" ]; then _mlIFS=$IFS; fi; IFS=' '; for _mlv in ${MODULES_RUN_QUARANTINE:-}; do if [ "${_mlv}" = "${_mlv##*[!A-Za-z0-9_]}" -a "${_mlv}" = "${_mlv#[0-9]}" ]; then if [ -n "`eval 'echo ${'$_mlv'+x}'`" ]; then _mlre="${_mlre:-}${_mlv}_modquar='`eval 'echo ${'$_mlv'}'`' "; fi; _mlrv="MODULES_RUNENV_${_mlv}"; _mlre="${_mlre:-}${_mlv}='`eval 'echo ${'$_mlrv':-}'`' "; fi; done; if [ -n "${_mlre:-}" ]; then _mlre="eval ${_mlre}"; fi; # define module command and surrounding initial environment (default value # for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files) _mlcode=`${_mlre:-}/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl ksh autoinit` _mlret=$? # clean temp variables used to setup quarantine if [ -n "${_mlIFS+x}" ]; then IFS=$_mlIFS; unset _mlIFS; else unset IFS; fi; unset _mlre _mlv _mlrv # no environment alteration if the above autoinit command failed if [ $_mlret -eq 0 ]; then eval "$_mlcode" # redefine module command if compat version has been activated if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then MODULES_CMD=/usr/share/Modules/libexec/modulecmd-compat export MODULES_CMD if [ -t 2 ]; then _module_raw() { eval `/usr/share/Modules/libexec/modulecmd-compat ksh $*`; } else module() { eval `/usr/share/Modules/libexec/modulecmd-compat ksh $*`; } fi fi # define function to switch between C and Tcl versions of Modules switchml() { typeset swfound=1 if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then typeset swname='main' if [ -e /usr/share/Modules/libexec/modulecmd.tcl ]; then typeset swfound=0 unset MODULES_USE_COMPAT_VERSION fi else typeset swname='compatibility' if [ -e /usr/share/Modules/libexec/modulecmd-compat ]; then typeset swfound=0 MODULES_USE_COMPAT_VERSION=1 export MODULES_USE_COMPAT_VERSION fi fi # switch version only if command found if [ $swfound -eq 0 ]; then echo "Switching to Modules $swname version" . /usr/share/Modules/init/ksh else echo "Cannot switch to Modules $swname version, command not found" return 1 fi } # setup FPATH to get module defined in 'ksh' interactive and non-interactive # sub-shells. only set in ksh init script to avoid side effect default FPATH # set for 'zsh' shell when it starts. _mlinstr=":$FPATH:" if [ "${_mlinstr#*:/usr/share/Modules/init/ksh-functions:}" = "$_mlinstr" ]; then FPATH=$FPATH${FPATH:+:}/usr/share/Modules/init/ksh-functions export FPATH fi _mlinstr=":$PATH:" if [ "${_mlinstr#*:/usr/share/Modules/bin:}" = "$_mlinstr" ]; then PATH=/usr/share/Modules/bin${PATH:+:}$PATH export PATH fi # initialize MANPATH if not set with a value that preserves manpath system # configuration even after addition of paths to this variable by modulefiles if [ ! -n "${MANPATH+x}" ]; then MANPATH=: export MANPATH fi _mlinstr=":`manpath 2>/dev/null`:" if [ "${_mlinstr#*:/usr/share/man:}" = "$_mlinstr" ]; then if [ "$MANPATH" = ':' ] || [ "$MANPATH" = '' ]; then _mlpathsep='' else _mlpathsep=: fi MANPATH=/usr/share/man$_mlpathsep$MANPATH export MANPATH unset _mlpathsep fi unset _mlinstr fi unset _mlcode _mlret # restore shell debugging options if disabled if [ -n "${_mlshdbg:-}" ]; then set -$_mlshdbg; unset _mlshdbg; fi; ksh-functions/ml 0000644 00000010102 15152714335 0007672 0 ustar 00 unset _mlshdbg; # disable shell debugging for the run of this init file if [ "${MODULES_SILENT_SHELL_DEBUG:-0}" = '1' ]; then # immediately disable debugging to echo the less number of line possible case "$-" in *v*x*) set +vx; _mlshdbg='vx' ;; *v*) set +v; _mlshdbg='v' ;; *x*) set +x; _mlshdbg='x' ;; *) _mlshdbg='' ;; esac; fi; # define modules runtine quarantine configuration export MODULES_RUN_QUARANTINE='LD_LIBRARY_PATH LD_PRELOAD' # setup quarantine if defined unset _mlre _mlIFS; if [ -n "${IFS+x}" ]; then _mlIFS=$IFS; fi; IFS=' '; for _mlv in ${MODULES_RUN_QUARANTINE:-}; do if [ "${_mlv}" = "${_mlv##*[!A-Za-z0-9_]}" -a "${_mlv}" = "${_mlv#[0-9]}" ]; then if [ -n "`eval 'echo ${'$_mlv'+x}'`" ]; then _mlre="${_mlre:-}${_mlv}_modquar='`eval 'echo ${'$_mlv'}'`' "; fi; _mlrv="MODULES_RUNENV_${_mlv}"; _mlre="${_mlre:-}${_mlv}='`eval 'echo ${'$_mlrv':-}'`' "; fi; done; if [ -n "${_mlre:-}" ]; then _mlre="eval ${_mlre}"; fi; # define module command and surrounding initial environment (default value # for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files) _mlcode=`${_mlre:-}/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl ksh autoinit` _mlret=$? # clean temp variables used to setup quarantine if [ -n "${_mlIFS+x}" ]; then IFS=$_mlIFS; unset _mlIFS; else unset IFS; fi; unset _mlre _mlv _mlrv # no environment alteration if the above autoinit command failed if [ $_mlret -eq 0 ]; then eval "$_mlcode" # redefine module command if compat version has been activated if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then MODULES_CMD=/usr/share/Modules/libexec/modulecmd-compat export MODULES_CMD if [ -t 2 ]; then _module_raw() { eval `/usr/share/Modules/libexec/modulecmd-compat ksh $*`; } else module() { eval `/usr/share/Modules/libexec/modulecmd-compat ksh $*`; } fi fi # define function to switch between C and Tcl versions of Modules switchml() { typeset swfound=1 if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then typeset swname='main' if [ -e /usr/share/Modules/libexec/modulecmd.tcl ]; then typeset swfound=0 unset MODULES_USE_COMPAT_VERSION fi else typeset swname='compatibility' if [ -e /usr/share/Modules/libexec/modulecmd-compat ]; then typeset swfound=0 MODULES_USE_COMPAT_VERSION=1 export MODULES_USE_COMPAT_VERSION fi fi # switch version only if command found if [ $swfound -eq 0 ]; then echo "Switching to Modules $swname version" . /usr/share/Modules/init/ksh else echo "Cannot switch to Modules $swname version, command not found" return 1 fi } # setup FPATH to get module defined in 'ksh' interactive and non-interactive # sub-shells. only set in ksh init script to avoid side effect default FPATH # set for 'zsh' shell when it starts. _mlinstr=":$FPATH:" if [ "${_mlinstr#*:/usr/share/Modules/init/ksh-functions:}" = "$_mlinstr" ]; then FPATH=$FPATH${FPATH:+:}/usr/share/Modules/init/ksh-functions export FPATH fi _mlinstr=":$PATH:" if [ "${_mlinstr#*:/usr/share/Modules/bin:}" = "$_mlinstr" ]; then PATH=/usr/share/Modules/bin${PATH:+:}$PATH export PATH fi # initialize MANPATH if not set with a value that preserves manpath system # configuration even after addition of paths to this variable by modulefiles if [ ! -n "${MANPATH+x}" ]; then MANPATH=: export MANPATH fi _mlinstr=":`manpath 2>/dev/null`:" if [ "${_mlinstr#*:/usr/share/man:}" = "$_mlinstr" ]; then if [ "$MANPATH" = ':' ] || [ "$MANPATH" = '' ]; then _mlpathsep='' else _mlpathsep=: fi MANPATH=/usr/share/man$_mlpathsep$MANPATH export MANPATH unset _mlpathsep fi unset _mlinstr fi unset _mlcode _mlret # restore shell debugging options if disabled if [ -n "${_mlshdbg:-}" ]; then set -$_mlshdbg; unset _mlshdbg; fi; perl.pm 0000644 00000002136 15152714335 0006054 0 ustar 00 # define modules runtine quarantine configuration $ENV{'MODULES_RUN_QUARANTINE'} = 'LD_LIBRARY_PATH LD_PRELOAD'; # setup quarantine if defined my $_mlre = ''; if (defined $ENV{'MODULES_RUN_QUARANTINE'}) { foreach my $_mlv (split(' ', $ENV{'MODULES_RUN_QUARANTINE'})) { if ($_mlv =~ /^[A-Za-z_][A-Za-z0-9_]*$/) { if (defined $ENV{$_mlv}) { $_mlre .= "${_mlv}_modquar='$ENV{$_mlv}' "; } my $_mlrv = "MODULES_RUNENV_$_mlv"; $_mlre .= "$_mlv='$ENV{$_mlrv}' "; } } if ($_mlre ne "") { $_mlre = "env $_mlre"; } } eval `${_mlre}/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl perl autoinit`; # clean temp variable used to setup quarantine undef $_mlre; # redefine module command if compat version has been activated if ($ENV{'MODULES_USE_COMPAT_VERSION'} eq '1') { $ENV{'MODULES_CMD'} = '/usr/share/Modules/libexec/modulecmd-compat'; { no warnings 'redefine'; *module = sub { eval `/usr/share/Modules/libexec/modulecmd-compat perl @_`; # return value as done on new main version return 1; }; } } 1; profile.sh 0000644 00000000700 15152714335 0006543 0 ustar 00 # get current shell name by querying shell variables or looking at parent # process name if [ -n "${BASH:-}" ]; then if [ "${BASH##*/}" = 'sh' ]; then shell='sh' else shell='bash' fi elif [ -n "${ZSH_NAME:-}" ]; then shell=$ZSH_NAME else shell=$(/usr/bin/basename $(/usr/bin/ps -p $$ -ocomm=)) fi if [ -f /usr/share/Modules/init/$shell ]; then . /usr/share/Modules/init/$shell else . /usr/share/Modules/init/sh fi csh 0000644 00000007442 15152714335 0005261 0 ustar 00 # define module command and surrounding initial environment (default value # for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files) eval "`/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl csh autoinit`" # no environment alteration if the above autoinit command failed if ( $status == 0 ) then # clarify compat version is not enabled for below tests if ( ! $?MODULES_USE_COMPAT_VERSION ) then setenv MODULES_USE_COMPAT_VERSION 0 endif # redefine module command if compat version has been activated if ( "$MODULES_USE_COMPAT_VERSION" == '1' ) then setenv MODULES_CMD /usr/share/Modules/libexec/modulecmd-compat ; if ( $?histchars && $?prompt ) alias module 'set _histchars = $histchars; unset histchars; set _prompt=$prompt:q; set prompt=""; eval `/usr/share/Modules/libexec/modulecmd-compat csh \!*`; set _exit="$status"; set histchars = $_histchars; unset _histchars; set prompt=$_prompt:q; unset _prompt; test 0 = $_exit' ; if ( $?histchars && ! $?prompt ) alias module 'set _histchars = $histchars; unset histchars; eval `/usr/share/Modules/libexec/modulecmd-compat csh \!*`; set _exit="$status"; set histchars = $_histchars; unset _histchars; test 0 = $_exit' ; if ( ! $?histchars && $?prompt ) alias module 'set _prompt=$prompt:q; set prompt=""; eval `/usr/share/Modules/libexec/modulecmd-compat csh \!*`; set _exit="$status"; set prompt=$_prompt:q;unset _prompt; test 0 = $_exit' ; if ( ! $?histchars && ! $?prompt ) alias module 'eval `/usr/share/Modules/libexec/modulecmd-compat csh \!*`' ; endif # define function to switch between C and Tcl versions of Modules set switchml_defined="`alias switchml`" if ( "$switchml_defined" == '' ) then alias switchml 'set swfound=1; \\ if ( ! $?MODULES_USE_COMPAT_VERSION ) setenv MODULES_USE_COMPAT_VERSION 0; \\ if ( "$MODULES_USE_COMPAT_VERSION" == "1" ) set swname="main"; \\ if ( "$MODULES_USE_COMPAT_VERSION" == "1" && -e /usr/share/Modules/libexec/modulecmd.tcl ) set swfound=0; \\ if ( "$MODULES_USE_COMPAT_VERSION" != "1" ) set swname="compatibility"; \\ if ( "$MODULES_USE_COMPAT_VERSION" != "1" && -e /usr/share/Modules/libexec/modulecmd-compat ) set swfound=0; \\ if ( $swfound == 0 && $swname == "main" ) setenv MODULES_USE_COMPAT_VERSION 0; \\ if ( $swfound == 0 && $swname == "compatibility" ) setenv MODULES_USE_COMPAT_VERSION 1; \\ if ( $swfound == 0 ) echo "Switching to Modules $swname version"; \\ if ( $swfound == 0 ) source /usr/share/Modules/init/csh; \\ if ( $swfound != 0 ) echo "Cannot switch to Modules $swname version, command not found"; \\ unset swfound swname;' endif unset switchml_defined if ( $?tcsh && $?prompt && -r /usr/share/Modules/init/tcsh_completion ) then if ( "$MODULES_USE_COMPAT_VERSION" != '1' ) then source /usr/share/Modules/init/tcsh_completion else # no completion support on compat version uncomplete module endif endif if ( ":${PATH}:" !~ '*:/usr/share/Modules/bin:*' ) then if ( "$PATH" == '' ) then setenv PATH /usr/share/Modules/bin else setenv PATH "/usr/share/Modules/bin:$PATH" endif endif if ( $?MANPATH ) then set manpath = $MANPATH else set manpath = `manpath` # initialize MANPATH if not set with a value that preserves manpath # system configuration even after addition of paths to this variable # by modulefiles setenv MANPATH : endif if ( ":${manpath}:" !~ '*:/usr/share/man:*' ) then if ( "$MANPATH" == '' || "$MANPATH" == ':' ) then set mlpathsep = '' else set mlpathsep = : endif setenv MANPATH "/usr/share/man$mlpathsep$MANPATH" unset mlpathsep endif unset manpath endif profile-compat.csh 0000644 00000000305 15152714335 0010170 0 ustar 00 # initialize compatibility version rather main version setenv MODULES_USE_COMPAT_VERSION 1 if ($?tcsh) then source /usr/share/Modules/init/tcsh else source /usr/share/Modules/init/csh endif sh 0000644 00000007644 15152714335 0005122 0 ustar 00 unset _mlshdbg; # disable shell debugging for the run of this init file if [ "${MODULES_SILENT_SHELL_DEBUG:-0}" = '1' ]; then # immediately disable debugging to echo the less number of line possible case "$-" in *v*x*) set +vx; _mlshdbg='vx' ;; *v*) set +v; _mlshdbg='v' ;; *x*) set +x; _mlshdbg='x' ;; *) _mlshdbg='' ;; esac; fi; # define modules runtine quarantine configuration export MODULES_RUN_QUARANTINE='LD_LIBRARY_PATH LD_PRELOAD' # setup quarantine if defined unset _mlre _mlIFS; if [ -n "${IFS+x}" ]; then _mlIFS=$IFS; fi; IFS=' '; for _mlv in ${MODULES_RUN_QUARANTINE:-}; do if [ "${_mlv}" = "${_mlv##*[!A-Za-z0-9_]}" -a "${_mlv}" = "${_mlv#[0-9]}" ]; then if [ -n "`eval 'echo ${'$_mlv'+x}'`" ]; then _mlre="${_mlre:-}${_mlv}_modquar='`eval 'echo ${'$_mlv'}'`' "; fi; _mlrv="MODULES_RUNENV_${_mlv}"; _mlre="${_mlre:-}${_mlv}='`eval 'echo ${'$_mlrv':-}'`' "; fi; done; if [ -n "${_mlre:-}" ]; then _mlre="eval ${_mlre}"; fi; # define module command and surrounding initial environment (default value # for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files) _mlcode=`${_mlre:-}/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl sh autoinit` _mlret=$? # clean temp variables used to setup quarantine if [ -n "${_mlIFS+x}" ]; then IFS=$_mlIFS; unset _mlIFS; else unset IFS; fi; unset _mlre _mlv _mlrv # no environment alteration if the above autoinit command failed if [ $_mlret -eq 0 ]; then eval "$_mlcode" # redefine module command if compat version has been activated if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then MODULES_CMD=/usr/share/Modules/libexec/modulecmd-compat export MODULES_CMD if [ -t 2 ]; then _module_raw() { eval `/usr/share/Modules/libexec/modulecmd-compat sh $*`; } else module() { eval `/usr/share/Modules/libexec/modulecmd-compat sh $*`; } fi fi # if sh is bash, export functions to get them defined in sub-shells if [ "${BASH:-}" != '' ]; then if [ -t 2 ]; then export -f _module_raw fi export -f module if [ "$(type -t ml)" = 'function' ]; then export -f ml fi fi # define function to switch between C and Tcl versions of Modules switchml() { swfound=1 if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then swname='main' if [ -e /usr/share/Modules/libexec/modulecmd.tcl ]; then swfound=0 unset MODULES_USE_COMPAT_VERSION fi else swname='compatibility' if [ -e /usr/share/Modules/libexec/modulecmd-compat ]; then swfound=0 MODULES_USE_COMPAT_VERSION=1 export MODULES_USE_COMPAT_VERSION fi fi # switch version only if command found if [ $swfound -eq 0 ]; then echo "Switching to Modules $swname version" . /usr/share/Modules/init/sh else echo "Cannot switch to Modules $swname version, command not found" return 1 fi } if [ "${BASH:-}" != '' ]; then export -f switchml fi case ":$PATH:" in *:/usr/share/Modules/bin:*) ;; *) PATH=/usr/share/Modules/bin${PATH:+:}$PATH export PATH esac # initialize MANPATH if not set with a value that preserves manpath system # configuration even after addition of paths to this variable by modulefiles if [ ! -n "${MANPATH+x}" ]; then MANPATH=: export MANPATH fi case ":`manpath 2>/dev/null`:" in *:/usr/share/man:*) ;; *) if [ "$MANPATH" = ':' ] || [ "$MANPATH" = '' ]; then _mlpathsep='' else _mlpathsep=: fi MANPATH=/usr/share/man$_mlpathsep$MANPATH export MANPATH unset _mlpathsep esac fi unset _mlcode _mlret # restore shell debugging options if disabled if [ -n "${_mlshdbg:-}" ]; then set -$_mlshdbg; unset _mlshdbg; fi; tcl 0000644 00000002057 15152714335 0005263 0 ustar 00 # define modules runtine quarantine configuration set env(MODULES_RUN_QUARANTINE) "LD_LIBRARY_PATH LD_PRELOAD" # setup quarantine if defined set _mlre {}; set _mlv ""; set _mlrv ""; if {[info exists env(MODULES_RUN_QUARANTINE)]} { foreach _mlv [split $env(MODULES_RUN_QUARANTINE) " "] { if {[regexp {^[A-Za-z_][A-Za-z0-9_]*$} $_mlv]} { if {[info exists env($_mlv)]} { lappend _mlre "${_mlv}_modquar=$env($_mlv)" } set _mlrv "MODULES_RUNENV_${_mlv}" if {[info exists env($_mlrv)]} { lappend _mlre "${_mlv}=$env($_mlrv)" } else { lappend _mlre "${_mlv}=" } } } if {[llength $_mlre] > 0} { set _mlre [linsert $_mlre 0 "env"] } } # define module command and surrounding initial environment (default value # for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files) eval [eval exec $_mlre "/usr/bin/tclsh" "/usr/share/Modules/libexec/modulecmd.tcl" "tcl" "autoinit" 2>@stderr] # clean temp variables used to setup quarantine unset _mlre _mlv _mlrv bash 0000644 00000010046 15152714335 0005413 0 ustar 00 unset _mlshdbg; # disable shell debugging for the run of this init file if [ "${MODULES_SILENT_SHELL_DEBUG:-0}" = '1' ]; then # immediately disable debugging to echo the less number of line possible case "$-" in *v*x*) set +vx; _mlshdbg='vx' ;; *v*) set +v; _mlshdbg='v' ;; *x*) set +x; _mlshdbg='x' ;; *) _mlshdbg='' ;; esac; fi; # define modules runtine quarantine configuration export MODULES_RUN_QUARANTINE='LD_LIBRARY_PATH LD_PRELOAD' # setup quarantine if defined unset _mlre _mlIFS; if [ -n "${IFS+x}" ]; then _mlIFS=$IFS; fi; IFS=' '; for _mlv in ${MODULES_RUN_QUARANTINE:-}; do if [ "${_mlv}" = "${_mlv##*[!A-Za-z0-9_]}" -a "${_mlv}" = "${_mlv#[0-9]}" ]; then if [ -n "`eval 'echo ${'$_mlv'+x}'`" ]; then _mlre="${_mlre:-}${_mlv}_modquar='`eval 'echo ${'$_mlv'}'`' "; fi; _mlrv="MODULES_RUNENV_${_mlv}"; _mlre="${_mlre:-}${_mlv}='`eval 'echo ${'$_mlrv':-}'`' "; fi; done; if [ -n "${_mlre:-}" ]; then _mlre="eval ${_mlre}"; fi; # define module command and surrounding initial environment (default value # for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files) _mlcode=`${_mlre:-}/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl bash autoinit` _mlret=$? # clean temp variables used to setup quarantine if [ -n "${_mlIFS+x}" ]; then IFS=$_mlIFS; unset _mlIFS; else unset IFS; fi; unset _mlre _mlv _mlrv # no environment alteration if the above autoinit command failed if [ $_mlret -eq 0 ]; then eval "$_mlcode" # redefine module command if compat version has been activated if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then MODULES_CMD=/usr/share/Modules/libexec/modulecmd-compat export MODULES_CMD if [ -t 2 ]; then _module_raw() { eval `/usr/share/Modules/libexec/modulecmd-compat bash $*`; } else module() { eval `/usr/share/Modules/libexec/modulecmd-compat bash $*`; } fi fi # export functions to get them defined in sub-shells if [ -t 2 ]; then export -f _module_raw fi export -f module if [ "$(type -t ml)" = 'function' ]; then export -f ml fi # define function to switch between C and Tcl versions of Modules switchml() { typeset swfound=1 if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then typeset swname='main' if [ -e /usr/share/Modules/libexec/modulecmd.tcl ]; then typeset swfound=0 unset MODULES_USE_COMPAT_VERSION fi else typeset swname='compatibility' if [ -e /usr/share/Modules/libexec/modulecmd-compat ]; then typeset swfound=0 MODULES_USE_COMPAT_VERSION=1 export MODULES_USE_COMPAT_VERSION fi fi # switch version only if command found if [ $swfound -eq 0 ]; then echo "Switching to Modules $swname version" source /usr/share/Modules/init/bash else echo "Cannot switch to Modules $swname version, command not found" return 1 fi } export -f switchml # enable completion only in interactive mode if [ ${BASH_VERSINFO:-0} -ge 3 ] && [[ $- =~ i ]] && [ -r /usr/share/Modules/init/bash_completion ]; then source /usr/share/Modules/init/bash_completion fi if [[ ! ":$PATH:" =~ ':/usr/share/Modules/bin:' ]]; then PATH=/usr/share/Modules/bin${PATH:+:}$PATH export PATH fi # initialize MANPATH if not set with a value that preserves manpath system # configuration even after addition of paths to this variable by modulefiles if [ ! -n "${MANPATH+x}" ]; then MANPATH=: export MANPATH fi if [[ ! ":`manpath 2>/dev/null`:" =~ ':/usr/share/man:' ]]; then if [ "$MANPATH" = ':' ] || [ "$MANPATH" = '' ]; then _mlpathsep='' else _mlpathsep=: fi MANPATH=/usr/share/man$_mlpathsep$MANPATH export MANPATH unset _mlpathsep fi fi unset _mlcode _mlret # restore shell debugging options if disabled if [ -n "${_mlshdbg:-}" ]; then set -$_mlshdbg; unset _mlshdbg; fi; python.py 0000644 00000003003 15152714335 0006441 0 ustar 00 import os, re, subprocess # define modules runtine quarantine configuration os.environ['MODULES_RUN_QUARANTINE'] = 'LD_LIBRARY_PATH LD_PRELOAD' # setup quarantine if defined _mlre = os.environ.copy() if 'MODULES_RUN_QUARANTINE' in os.environ: for _mlv in os.environ['MODULES_RUN_QUARANTINE'].split(): if re.match('^[A-Za-z_][A-Za-z0-9_]*$', _mlv): if _mlv in os.environ: _mlre[_mlv + '_modquar'] = os.environ[_mlv] _mlrv = 'MODULES_RUNENV_' + _mlv if _mlrv in os.environ: _mlre[_mlv] = os.environ[_mlrv] else: _mlre[_mlv] = '' # define module command and surrounding initial environment (default value # for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files) exec(subprocess.Popen(['/usr/bin/tclsh', '/usr/share/Modules/libexec/modulecmd.tcl', 'python', 'autoinit'], stdout=subprocess.PIPE, env=_mlre).communicate()[0]) # clean temp variable used to setup quarantine del _mlre # redefine module command if compat version has been activated if 'MODULES_USE_COMPAT_VERSION' in os.environ and os.environ['MODULES_USE_COMPAT_VERSION'] == '1': os.environ['MODULES_CMD'] = '/usr/share/Modules/libexec/modulecmd-compat' # set module command in accordance with active version def module(command, *arguments): exec(subprocess.Popen(['/usr/share/Modules/libexec/modulecmd-compat', 'python', command] + list(arguments), stdout=subprocess.PIPE).communicate()[0]) # return value as done on new main version return True r.R 0000644 00000001701 15152714335 0005135 0 ustar 00 # define modules runtine quarantine configuration Sys.setenv('MODULES_RUN_QUARANTINE'='LD_LIBRARY_PATH LD_PRELOAD') # setup quarantine if defined mlre <- '' if (!is.na(Sys.getenv('MODULES_RUN_QUARANTINE', unset=NA))) { for (mlv in strsplit(Sys.getenv('MODULES_RUN_QUARANTINE'), ' ')[[1]]) { if (grepl('^[A-Za-z_][A-Za-z0-9_]*$', mlv)) { if (!is.na(Sys.getenv(mlv, unset=NA))) { mlre <- paste0(mlre, mlv, "_modquar='", Sys.getenv(mlv), "' ") } mlrv <- paste0('MODULES_RUNENV_', mlv) mlre <- paste0(mlre, mlv, "='", Sys.getenv(mlrv), "' ") } } if (mlre != '') { mlre <- paste0('env ', mlre) } } # define module command and surrounding initial environment (default value # for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files) cmdpipe <- pipe(paste0(mlre, '/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl r autoinit')) eval(parse(cmdpipe)) close(cmdpipe) profile-compat.sh 0000644 00000000465 15152714336 0010035 0 ustar 00 # initialize compatibility version rather main version MODULES_USE_COMPAT_VERSION=1 export MODULES_USE_COMPAT_VERSION shell=$(/usr/bin/basename $(/usr/bin/ps -p $$ -ocomm=)) if [ -f /usr/share/Modules/init/$shell ]; then source /usr/share/Modules/init/$shell else source /usr/share/Modules/init/sh fi