]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix solver.sh
authorspo <sergey.pokhodenko@opencascade.com>
Fri, 25 Dec 2015 10:44:36 +0000 (13:44 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Fri, 25 Dec 2015 10:44:36 +0000 (13:44 +0300)
solver.sh

index c4a2426ac76936bd66a1ad75e29f8c8c5adf5d80..fb002a6af65ea49f70d25e909dc4517d1c7e200f 100755 (executable)
--- a/solver.sh
+++ b/solver.sh
@@ -2,7 +2,6 @@
 #
 # Modify plugins.xml to switch solver
 
-export solver=${solver:-SolveSpace}
 export PLUGINS_PATH=${PLUGINS_PATH:-${NEWGEOM_ROOT_DIR}/plugins/plugins.xml}
 
 while [[ $# > 0 ]]; do
@@ -27,6 +26,8 @@ while [[ $# > 0 ]]; do
   esac
 done
 
+if [[ -z ${solver:-} ]]; then exit 0; fi
+
 case $solver in
   PlaneGCS)
     export SWITCH_ON=PlaneGCSSolver
@@ -41,8 +42,9 @@ esac
 echo "Switch $solver solver in ${PLUGINS_PATH}"
 
 cat ${PLUGINS_PATH} \
-  | sed -e "s/^\(<!--\)\?\(.*${SWITCH_ON}.*\/>\)\( -->\)\?/\2/" \
-  | sed -e "s/^\(<!--\)\?\(.*${SWITCH_OFF}.*\/>\)\( -->\)\?/<!--\2 -->/" \
+  | tr '\n' '\r' \
+  | sed -e "s|\r  <plugin library=\"[^\r]*Solver\"\/>\r<!--|\r  <plugin library=\"${solver}Solver\"\/>\r<!--|" \
+  | tr '\r' '\n' \
   > ${PLUGINS_PATH}_out
 mv -f ${PLUGINS_PATH}_out ${PLUGINS_PATH}
 cat ${PLUGINS_PATH}