Automatically determine the additional version specification from the directory name of the installation
--HG-- branch : bgschaid/minorAdditionsBranch
This commit is contained in:
parent
a10196a180
commit
93e80e2c87
2 changed files with 55 additions and 1 deletions
29
etc/bashrc
29
etc/bashrc
|
@ -43,6 +43,35 @@ unset prefSettingFile
|
|||
|
||||
export WM_PROJECT=OpenFOAM
|
||||
export WM_PROJECT_VERSION=1.6-ext
|
||||
|
||||
if [ -z "$WM_PROJECT_VERSION_ADDITION" ]
|
||||
then
|
||||
fullScriptPath=`pwd`"/$0"
|
||||
canonicalFullScriptPath="$(readlink 2>&1 -f $fullScriptPath)"
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
# System with simpler readlink (BSD, Darwin) try replacement
|
||||
canonicalFullScriptPath="$(greadlink 2>&1 -f $fullScriptPath)"
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
# we give up
|
||||
canonicalFullScriptPath=""
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$canonicalFullScriptPath" ]
|
||||
then
|
||||
dirName="$(basename $(dirname $(dirname $canonicalFullScriptPath)))"
|
||||
rest="$(echo $dirName | sed -e "s/OpenFOAM-$WM_PROJECT_VERSION//")"
|
||||
if [ -n $rest ]
|
||||
then
|
||||
export WM_PROJECT_VERSION_ADDITION="$(echo $rest | sed -e "s/-//")"
|
||||
fi
|
||||
unset dirName rest
|
||||
fi
|
||||
unset fullScriptPath canonicalFullScriptPath
|
||||
fi
|
||||
|
||||
if [ -n "$WM_PROJECT_VERSION_ADDITION" ]
|
||||
then
|
||||
export WM_PROJECT_VERSION=$WM_PROJECT_VERSION-$WM_PROJECT_VERSION_ADDITION
|
||||
|
|
27
etc/cshrc
27
etc/cshrc
|
@ -42,11 +42,36 @@ if ( -r $prefSettingFile ) then
|
|||
# echo "Found presettings $prefSettingFile"
|
||||
source $prefSettingFile
|
||||
endif
|
||||
unset prefSettingFile,called
|
||||
|
||||
setenv WM_PROJECT OpenFOAM
|
||||
setenv WM_PROJECT_VERSION 1.6-ext
|
||||
|
||||
if( ! $?WM_PROJECT_VERSION_ADDITION ) then
|
||||
set fullScriptPath = `pwd`"/$called[2]"
|
||||
set canonicalFullScriptPath = `readlink -f $fullScriptPath |& cat`
|
||||
if( $? != 0 ) then
|
||||
# System with simpler readlink (BSD, Darwin) try replacement
|
||||
set canonicalFullScriptPath=`greadlink -f $fullScriptPath |& cat`
|
||||
if ( $? != 0 ) then
|
||||
# we give up
|
||||
set canonicalFullScriptPath=""
|
||||
endif
|
||||
endif
|
||||
|
||||
if ( "$canonicalFullScriptPath" != "" ) then
|
||||
set pathHere=`dirname $canonicalFullScriptPath`
|
||||
set pathHere=`dirname $pathHere`
|
||||
set dirName=`basename $pathHere`
|
||||
set rest=`echo $dirName | sed -e "s/OpenFOAM-$WM_PROJECT_VERSION//"`
|
||||
if ( "$rest" != "" ) then
|
||||
setenv WM_PROJECT_VERSION_ADDITION `echo $rest | sed -e "s/-//"`
|
||||
endif
|
||||
unset dirName pathHere rest
|
||||
endif
|
||||
unset fullScriptPath canonicalFullScriptPath
|
||||
endif
|
||||
unset prefSettingFile called
|
||||
|
||||
if ( $?WM_PROJECT_VERSION_ADDITION ) then
|
||||
setenv WM_PROJECT_VERSION $WM_PROJECT_VERSION-$WM_PROJECT_VERSION_ADDITION
|
||||
endif
|
||||
|
|
Reference in a new issue