What works in tcsh doesn't work in csh (although most systems nowadays use tcsh as csh)
--HG-- branch : bgschaid/minorAdditionsBranch
This commit is contained in:
parent
fdcfb61f0b
commit
7def1e6da1
1 changed files with 22 additions and 9 deletions
31
etc/cshrc
31
etc/cshrc
|
@ -36,21 +36,33 @@ unset WM_PROJECT_VERSION_ADDITION
|
||||||
unsetenv WM_PROJECT_VERSION_ADDITION
|
unsetenv WM_PROJECT_VERSION_ADDITION
|
||||||
|
|
||||||
set called=($_)
|
set called=($_)
|
||||||
set prefSettingFile=$called[2].preset
|
if ( $#called != 1 ) then
|
||||||
|
# tcsh - csh doesn't know about the location
|
||||||
|
set thisScript=$called[2]
|
||||||
|
set prefSettingFile=$thisScript.preset
|
||||||
|
|
||||||
if ( -r $prefSettingFile ) then
|
if ( -r $prefSettingFile ) then
|
||||||
# echo "Found presettings $prefSettingFile"
|
# echo "Found presettings $prefSettingFile"
|
||||||
source $prefSettingFile
|
source $prefSettingFile
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
echo "csh - WM_PROJECT_VERSION_ADDITION not supported"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
setenv WM_PROJECT OpenFOAM
|
setenv WM_PROJECT OpenFOAM
|
||||||
setenv WM_PROJECT_VERSION 1.6-ext
|
setenv WM_PROJECT_VERSION 1.6-ext
|
||||||
|
|
||||||
if( ! $?WM_PROJECT_VERSION_ADDITION ) then
|
if ( $#called != 1 ) then
|
||||||
setenv WM_PROJECT_VERSION_ADDITION `python -c "from os.path import *;print abspath(join(curdir,'$called[2]')).split(sep)[-3][len('OpenFOAM-$WM_PROJECT_VERSION')+1:]"`
|
if( ! $?WM_PROJECT_VERSION_ADDITION ) then
|
||||||
unset called
|
setenv WM_PROJECT_VERSION_ADDITION `python -c "from os.path import *;print abspath(join(curdir,'$thisScript')).split(sep)[-3][len('OpenFOAM-$WM_PROJECT_VERSION')+1:]"`
|
||||||
|
if ( "$WM_PROJECT_VERSION_ADDITION" == "" ) then
|
||||||
|
unsetenv WM_PROJECT_VERSION_ADDITION
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
unset prefSettingFile thisScript
|
||||||
endif
|
endif
|
||||||
unset prefSettingFile called
|
|
||||||
|
unset called
|
||||||
|
|
||||||
if ( $?WM_PROJECT_VERSION_ADDITION ) then
|
if ( $?WM_PROJECT_VERSION_ADDITION ) then
|
||||||
setenv WM_PROJECT_VERSION $WM_PROJECT_VERSION-$WM_PROJECT_VERSION_ADDITION
|
setenv WM_PROJECT_VERSION $WM_PROJECT_VERSION-$WM_PROJECT_VERSION_ADDITION
|
||||||
|
@ -100,8 +112,9 @@ alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; source
|
||||||
|
|
||||||
# Add in preset user or site preferences:
|
# Add in preset user or site preferences:
|
||||||
set foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh`
|
set foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh`
|
||||||
|
|
||||||
if ( $status == 0 ) then
|
if ( $status == 0 ) then
|
||||||
if ( $?foamPrefs ) then
|
if ( "$foamPrefs" != "" ) then
|
||||||
_foamSource $foamPrefs
|
_foamSource $foamPrefs
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
Reference in a new issue