From: maintenance team Date: Fri, 30 May 2008 10:10:56 +0000 (+0000) Subject: NPAL19849: Improve installation wizard : generate config_appli.xml during the install... X-Git-Tag: V4_1_3~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4f59f003d65c9188153c0ca210f7f7ce44cd1ef1;p=tools%2Finstall.git NPAL19849: Improve installation wizard : generate config_appli.xml during the installation. --- diff --git a/config_files/KERNEL.sh b/config_files/KERNEL.sh index d16048a..86b554f 100755 --- a/config_files/KERNEL.sh +++ b/config_files/KERNEL.sh @@ -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 index 0000000..ddd19c8 --- /dev/null +++ b/config_files/create_config.sh @@ -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 tag +echo "" >> ${CONFIG_FILE} + +# tag : path to the environment script +echo " " >> ${CONFIG_FILE} + +# begin tag +echo " " >> ${CONFIG_FILE} + +# for each module create 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 " " >> ${CONFIG_FILE} +done + +# end tag +echo " " >> ${CONFIG_FILE} + +# tag : path to the samples directory +if [ -n ${DATA_DIR} ] && [ -d ${DATA_DIR} ] ; then + echo " " >> ${CONFIG_FILE} +fi + +# end tag +echo "" >> ${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