]> SALOME platform Git repositories - tools/install.git/commitdiff
Salome HOME
NPAL19849: Improve installation wizard : generate config_appli.xml during the install...
authormaintenance team <salome-mnt@opencascade.com>
Fri, 30 May 2008 10:10:56 +0000 (10:10 +0000)
committermaintenance team <salome-mnt@opencascade.com>
Fri, 30 May 2008 10:10:56 +0000 (10:10 +0000)
config_files/KERNEL.sh
config_files/create_config.sh [new file with mode: 0755]

index d16048a17bb12d0be9d694f7a0a0a58f4c7a3fca..86b554f993f78a917c3f13f221ac2f246cf8d8b8 100755 (executable)
@@ -143,13 +143,15 @@ pickup_env()
 {
 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE} ${PRODUCT_DIR}
 if [ -d ${PRODUCT_DIR} ] ; then
-    cd ${PRODUCT_DIR}
+    pushd ${PRODUCT_DIR}
     version=`cat bin/salome/VERSION | awk -F: '{print $2}' | tr -d '[:space:]'`
     dir="${HOME}/salome_appli_$version"
     bin/salome/createAppli.sh $dir
     rm -rf $dir/env.d/*.sh
     cp -f ${PRODUCT_DIR}/salome.sh $dir/env.d
+    popd
 fi
+create_config.sh ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_DIR}
 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src ${PRODUCT_SRC_DIR}
 }
 
diff --git a/config_files/create_config.sh b/config_files/create_config.sh
new file mode 100755 (executable)
index 0000000..ddd19c8
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/bash -noprofile
+
+####################################################################################
+#  File      : create_config.sh
+#  Created   : Fri May 30 10:40:01 2008
+#  Author    : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
+#  Project   : SALOME
+#  Module    : Installation Wizard
+#  Copyright : 2002-2008 CEA
+#
+#  This script is the part of the SALOME installation procedure.
+#
+####################################################################################
+
+export INSTALL_ROOT=$1
+export INSTALL_WORK=$2
+export PRODUCT_SEQUENCE=$3
+export PRODUCT_DIR=$4
+
+# --- configuration file ---
+CONFIG_FILE=${INSTALL_WORK}/config_appli.xml
+
+# create and source environment file
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+source ${INSTALL_WORK}/$SHRC
+
+# remove config file
+if [ -e ${CONFIG_FILE} ] ; then
+    rm ${CONFIG_FILE}
+fi
+# create empty config file
+touch ${CONFIG_FILE}
+
+# begin <application> tag
+echo "<application>" >> ${CONFIG_FILE}
+
+# <prerequisites> tag : path to the environment script
+echo "  <prerequisites path=\"${INSTALL_ROOT}/env_products.sh\"/>" >> ${CONFIG_FILE}
+
+# begin <modules> tag
+echo "  <modules>" >> ${CONFIG_FILE}
+
+# for each module create <module> tag
+SALOME_MODULES="`env | awk -F_ '/[a-zA-Z0-9]*_ROOT_DIR/ { print $1 }' | grep -v -E '^SALOME$' | grep -v -E '^HXX2SALOME$'`"
+GUI_MODULES="`echo $SALOME_MODULES | tr \"[:space:]\" \"\n\" | grep -v -E \"(^KERNEL|^GUI|^SAMPLES|PLUGIN)$\"`"
+for mod in ${SALOME_MODULES}; do
+    echo ${GUI_MODULES} | tr "[:space:]" "\n" | grep -E "^${mod}$" >& /dev/null
+    if [ "$?" == "0" ] ; then
+       gui_attr="yes"
+    else
+       gui_attr="no"
+    fi
+    path_attr="`printenv ${mod}_ROOT_DIR`"
+    echo "    <module name=\"${mod}\" gui=\"${gui_attr}\" path=\"${path_attr}\"/>" >> ${CONFIG_FILE}
+done
+
+# end <modules> tag
+echo "  </modules>" >> ${CONFIG_FILE}
+
+# <samples> tag : path to the samples directory
+if [ -n ${DATA_DIR} ] && [ -d ${DATA_DIR} ] ; then
+    echo "  <samples path=\"${DATA_DIR}\"/>" >> ${CONFIG_FILE}
+fi
+
+# end <application> tag
+echo "</application>" >> ${CONFIG_FILE}
+
+# copy resulting confuguration file to the KERNEL module
+if [ -n ${PRODUCT_DIR} ] && [ -d ${PRODUCT_DIR} ] ; then
+    cp -f ${CONFIG_FILE} ${PRODUCT_DIR}/bin/salome
+fi