foamConfigurePaths: Updated foamInstall option

This commit is contained in:
Henry Weller 2016-06-06 19:32:01 +01:00
parent 2b71ea6f58
commit f2d9959bae

View File

@ -79,10 +79,10 @@ _inlineSed()
[ -f etc/bashrc ] || usage "Please run from top-level directory of installation" [ -f etc/bashrc ] || usage "Please run from top-level directory of installation"
unset foamInstall projectName projectVersion archOption unset foamInstDir projectName projectVersion archOption
unset paraviewInstall scotchArchPath unset paraviewInstall scotchArchPath
# parse options # Parse options
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
do do
case "$1" in case "$1" in
@ -91,13 +91,18 @@ do
;; ;;
-foamInstall | --foamInstall) -foamInstall | --foamInstall)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument" [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
foamInstall="$2" foamInstDir="$2"
# replace foamInstall=... # Replace FOAM_INST_DIR=...
_inlineSed \ _inlineSed \
etc/bashrc \ etc/bashrc \
'foamInstall=.*' \ '\(.*BASH_SOURCE.*\)' \
'foamInstall='"$foamInstall" \ '#\1' \
"Replacing foamInstall setting by '$foamInstall'" "Removing default FOAM_INST_DIR setting"
_inlineSed \
etc/bashrc \
'^export FOAM_INST_DIR=.*' \
'export FOAM_INST_DIR='"$foamInstDir" \
"Setting FOAM_INST_DIR to '$foamInstDir'"
shift 2 shift 2
;; ;;
-projectName | --projectName) -projectName | --projectName)
@ -189,7 +194,7 @@ do
esac esac
done done
[ -n "$foamInstall" -o -n "$projectName" -o -n "$projectVersion" -o -n "$archOption" \ [ -n "$foamInstDir" -o -n "$projectName" -o -n "$projectVersion" -o -n "$archOption" \
-o -n "$paraviewInstall" -o -n "$paraviewVersion" \ -o -n "$paraviewInstall" -o -n "$paraviewVersion" \
-o -n "$scotchVersion" -o -n "$scotchArchPath" \ -o -n "$scotchVersion" -o -n "$scotchArchPath" \
] || usage "Please specify at least one configure option" ] || usage "Please specify at least one configure option"