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:
Bernhard F.W. Gschaider 2013-09-05 01:31:14 +02:00
parent fdcfb61f0b
commit 7def1e6da1

View file

@ -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 endif
else
echo "csh - WM_PROJECT_VERSION_ADDITION not supported"
endif
setenv WM_PROJECT OpenFOAM setenv WM_PROJECT OpenFOAM
setenv WM_PROJECT_VERSION 1.6-ext setenv WM_PROJECT_VERSION 1.6-ext
if ( $#called != 1 ) then
if( ! $?WM_PROJECT_VERSION_ADDITION ) then if( ! $?WM_PROJECT_VERSION_ADDITION ) 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:]"` 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:]"`
unset called if ( "$WM_PROJECT_VERSION_ADDITION" == "" ) then
unsetenv WM_PROJECT_VERSION_ADDITION
endif endif
unset prefSettingFile called endif
unset prefSettingFile thisScript
endif
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