Commit a45f394c authored by mattijs's avatar mattijs
Browse files

BUG: foamConfigurePaths : incorrect logic

parent bbf218d6
...@@ -53,7 +53,8 @@ _inlineSed() ...@@ -53,7 +53,8 @@ _inlineSed()
backup=`tempfile` backup=`tempfile`
cp $1 $backup cp $1 $backup
sed -i -e "$2" $1 sed -i -e "$2" $1
cmp $1 $backup || usage "Failed : $3" cmp --quiet $1 $backup && usage "Failed : $3"
return 0
} }
...@@ -70,9 +71,7 @@ do ...@@ -70,9 +71,7 @@ do
;; ;;
--foamInstall) --foamInstall)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument" [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
foamInstall="$2" foamInstall="$2"
echo "** foamInstall:$foamInstall"
_inlineSed \ _inlineSed \
etc/bashrc \ etc/bashrc \
'/^[^#]/s@foamInstall=.*@foamInstall='"$foamInstall@" \ '/^[^#]/s@foamInstall=.*@foamInstall='"$foamInstall@" \
...@@ -81,7 +80,7 @@ do ...@@ -81,7 +80,7 @@ do
;; ;;
--projectName) --projectName)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument" [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
projectName="$2" projectName="$2"
_inlineSed \ _inlineSed \
etc/bashrc \ etc/bashrc \
'/^[^#]/s@WM_PROJECT_DIR=.*@WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/'"$projectName@" \ '/^[^#]/s@WM_PROJECT_DIR=.*@WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/'"$projectName@" \
...@@ -90,7 +89,7 @@ do ...@@ -90,7 +89,7 @@ do
;; ;;
--archOption) --archOption)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument" [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
archOption="$2" archOption="$2"
_inlineSed \ _inlineSed \
etc/bashrc \ etc/bashrc \
'/^[^#]/s@: ${WM_ARCH_OPTION:=64}@WM_ARCH_OPTION='"$archOption@" \ '/^[^#]/s@: ${WM_ARCH_OPTION:=64}@WM_ARCH_OPTION='"$archOption@" \
...@@ -99,7 +98,7 @@ do ...@@ -99,7 +98,7 @@ do
;; ;;
--paraviewInstall) --paraviewInstall)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument" [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
paraviewInstall="$2" paraviewInstall="$2"
_inlineSed \ _inlineSed \
etc/apps/paraview3/bashrc \ etc/apps/paraview3/bashrc \
'/^[^#]/s@ParaView_DIR=.*@ParaView_DIR='"$paraviewInstall@" \ '/^[^#]/s@ParaView_DIR=.*@ParaView_DIR='"$paraviewInstall@" \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment