mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
CONFIG: eliminate most occurances of outdated FOAM_INST_DIR (issue #444)
- since 1612, FOAM_INST_DIR and foamInstDir longer have any special meanings when sourcing the bashrc or cshrc files. Thus no need for special treatment in any of the dispatch wrappers. Retained FOAM_INST_DIR as (unexported) variable in etc/bashrc, just in case people are using patched versions of etc/bashrc as part of their installation. ENH: relax prefix restrictions on foamCreateVideo (issue #904) - shift the implicit '.' to be part of the default prefix. This allows things like "-image myimages_00" to work as might be expected.
This commit is contained in:
@ -65,31 +65,30 @@ wmRefresh()
|
||||
}
|
||||
|
||||
|
||||
# Change OpenFOAM version
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# Query the current OpenFOAM version
|
||||
# or change to another version (if installed in a parallel directory)
|
||||
unset -f foamVersion 2>/dev/null
|
||||
foamVersion()
|
||||
{
|
||||
if [ "$#" -gt 0 ]
|
||||
then
|
||||
local dir="${WM_PROJECT_DIR%/*}" # Parent directory
|
||||
local ver=$1
|
||||
shift
|
||||
# The variable foamInstDir had meaning for older OpenFOAM versions
|
||||
foamInstDir=$FOAM_INST_DIR
|
||||
if [ -f "$foamInstDir/OpenFOAM-$ver/etc/bashrc" ]
|
||||
|
||||
if [ -f "$dir/OpenFOAM-$ver/etc/bashrc" ]
|
||||
then
|
||||
wmUnset
|
||||
. $foamInstDir/OpenFOAM-$ver/etc/bashrc
|
||||
unset foamInstDir
|
||||
. $dir/OpenFOAM-$ver/etc/bashrc
|
||||
foam
|
||||
echo "Changed to OpenFOAM-$WM_PROJECT_VERSION" 1>&2
|
||||
else
|
||||
unset foamInstDir
|
||||
echo "No OpenFOAM-$ver available" 1>&2
|
||||
echo "No OpenFOAM-$ver available in $dir" 1>&2
|
||||
echo "Using OpenFOAM-$WM_PROJECT_VERSION" 1>&2
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
# Treat as query. Report current version
|
||||
echo "OpenFOAM-$WM_PROJECT_VERSION" 1>&2
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user