Commit 9e7255fa authored by gsell's avatar gsell
Browse files

file for csh support added, still not usable

parent 8f3edefc
if ($?tcsh) then
set modules_shell="tcsh"
else
set modules_shell="csh"
endif
set exec_prefix='/usr/bin'
set prefix=""
set postfix=""
if ( $?histchars ) then
set histchar = `echo $histchars | cut -c1`
set _histchars = $histchars
set prefix = 'unset histchars;'
set postfix = 'set histchars = $_histchars;'
else
set histchar = \!
endif
if ($?prompt) then
set prefix = "$prefix"'set _prompt="$prompt";set prompt="";'
set postfix = "$postfix"'set prompt="$_prompt";unset _prompt;'
endif
if ($?noglob) then
set prefix = "$prefix""set noglob;"
set postfix = "$postfix""unset noglob;"
endif
set postfix = "set _exit="'$status'"; $postfix; test 0 = "'$_exit;'
alias module $prefix'eval `'$exec_prefix'/modulecmd '$modules_shell' '$histchar'*`; '$postfix
unset exec_prefix
unset prefix
unset postfix
setenv MODULESHOME /usr/share/Modules
if (! $?MODULEPATH ) then
setenv MODULEPATH `sed -n 's/[ #].*$//; /./H; $ { x; s/^\n//; s/\n/:/g; p; }' ${MODULESHOME}/init/.modulespath`
endif
if (! $?LOADEDMODULES ) then
setenv LOADEDMODULES ""
endif
#!/bin/tcsh
setenv PSI_PREFIX "/opt/psi"
if ( "$PMODULES_VERSION" == "" ) then
setenv PMODULES_VERSION "0.99.1"
endif
setenv PMODULES_HOME "$PSI_PREFIX/Tools/Pmodules/$PMODULES_VERSION"
setenv PSI_CONFIG_DIR "config"
setenv PSI_MODULES_ROOT 'modulefiles'
setenv PSI_TEMPLATES_DIR 'templates'
setenv PSI_DEFAULT_FAMILIES 'Tools Programming'
setenv PSI_RELEASES ':unstable:stable:deprecated:'
setenv PSI_USED_RELEASES 'stable'
#!/bin/tcsh
#############################################################################
# read Pmodules configuration
#
set _init_env_file="/opt/psi/config/environment.bash"
if ( ! -r "$_init_env_file" ); then
echo "Oops: cannot initialize Modules!"
echo "$_init_env_file: file does not exist or is not readable."
return 1
fi
source "$_init_env_file"
unset _init_env_file
############################################################################
# check configuration
#
if ( ! $?PSI_PREFIX ) then
echo "Oops: Pmodules prefix not set."
return 1
endif
if ( "$PSI_PREFIX" == "" ) then
echo "Oops: Pmodules prefix set to empty string!"
endif
if ( ! -d ${PSI_PREFIX} ) then
echo "Oops: ${PSI_PREFIX}: Set as Pmodules prefix, but this is not a directory!"
return 1
endif
if ( ! $?PMODULES_VERSION ) then
echo "Oops: Pmodules version not set!"
return 1
endif
if ( "$PMODULES_VERSION" == "" ) then
echo "Oops: Pmodules version set to empty string!"
return 1
endif
if ( $?PMODULES_HOME ) then
echo "Oops: Pmodules home not set!"
return 1
endif
if ( "$PMODULES_HOME" == "" ) then
echo "Oops: Pmodules home set to empty string!"
return 1
fi
if ( ! -d "$PMODULES_HOME" ) then
echo "Oops: $PMODULES_HOME: Set as Pmodules home, but this is not a directory!"
return 1
endif
############################################################################
# inititialize Pmodules for bash
#
set _init_csh="$PMODULES_HOME/init/csh"
if ( ! -r "$_init_csh" ) then
echo "Oops: cannot initialize Modules!"
echo "$_init_csh: File does not exist or is not readable."
return 1
fi
source "$_init_csh"
unset _init_csh
# Local Variables:
# mode: csh
# sh-basic-offset: 8
# tab-width: 8
# End:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment