From: crouzet Date: Mon, 9 Jul 2007 10:35:17 +0000 (+0000) Subject: bug report from V3_0_maintenance (09/07/2007) X-Git-Tag: V4_1_0~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9f4b3d66dbb973a6f0bef302c251ae4aab2c590a;p=tools%2Fhxx2salome.git bug report from V3_0_maintenance (09/07/2007) Salome 4.0 compatibility --- diff --git a/scripts/hxx2salome b/scripts/hxx2salome index bc2e588..6c3911b 100755 --- a/scripts/hxx2salome +++ b/scripts/hxx2salome @@ -190,7 +190,10 @@ generate_module_source() echo -e "\n-> Duplicate template module" | tee hxx2salome_journal tar xvfz ${gene_dir}/template_src.tgz >> hxx2salome_journal mv HXX2SALOME_GENERIC_CLASS_NAME_SRC ${CLASS_NAME}_SRC - ${gene_dir}/renameSalomeModule -i HXX2SALOME_GENERIC_CLASS_NAME ${CLASS_NAME} ${CLASS_NAME}_SRC >> hxx2salome_journal + ${gene_dir}/renameSalomeModule -i HXX2SALOME_GENERIC_CLASS_NAME ${CLASS_NAME} ${CLASS_NAME}_SRC + ###>> hxx2salome_journal + ${gene_dir}/renameSalomeModule -i hxx2salome_generic_class_name ${class_name} ${CLASS_NAME}_SRC + ###>> hxx2salome_journal # if [ $make_gui -eq 0 ] then @@ -230,8 +233,8 @@ generate_module_source() sed "s?HXX2SALOME_INCLUDE?${makefile_include}?g s?HXX2SALOME_PYTHON_FILE?${python_test_file}?g s?HXX2SALOME_LIB?${makefile_lib}?g - " ${CLASS_NAME}_SRC/src/${CLASS_NAME}/Makefile.in > tmpfile - mv tmpfile ${CLASS_NAME}_SRC/src/${CLASS_NAME}/Makefile.in + " ${CLASS_NAME}_SRC/src/${CLASS_NAME}/Makefile.am > tmpfile + mv tmpfile ${CLASS_NAME}_SRC/src/${CLASS_NAME}/Makefile.am # # generate component catalog echo -e "\n-> Generate component catalog" | tee hxx2salome_journal @@ -481,17 +484,38 @@ else fi fi +# look up hxx2salome scripts +# - first search in directory ${HXX2SALOME_ROOT_DIR} (if the variable is defined) +# - then search in directory ${HXX2SALOME_ROOT_DIR}/bin +# - finally seach locally. # if [ ${HXX2SALOME_ROOT_DIR} ] && [ -d ${HXX2SALOME_ROOT_DIR} ] then - gene_dir=${HXX2SALOME_ROOT_DIR} + echo " HXX2SALOME_ROOT_DIR variable is defined : ${HXX2SALOME_ROOT_DIR} => we look up hxx2salome scripts inside" + if [ -f ${HXX2SALOME_ROOT_DIR}/parse1.awk -a -f ${HXX2SALOME_ROOT_DIR}/parse2.awk ] # check if script are found in ${HXX2SALOME_ROOT_DIR} + then + gene_dir=${HXX2SALOME_ROOT_DIR} + elif [ -f ${HXX2SALOME_ROOT_DIR}/bin/parse1.awk -a -f ${HXX2SALOME_ROOT_DIR}/bin/parse2.awk ] # else check /bin directory + then + gene_dir=${HXX2SALOME_ROOT_DIR}/bin + else + echo -e "\nError : Variable HXX2SALOME_ROOT_DIR not correctly set" + usage + fi else - gene_dir=`pwd` # case where hxx2salome was launched from HXX2SALOME directory + echo "HXX2SALOME_ROOT_DIR directory not set => we look up hxx2salome scripts locally" + if [ -f parse1.awk -a -f parse2.awk ] # check if script are found locally + then + gene_dir=`pwd` # case where hxx2salome was launched from HXX2SALOME directory + else + echo -e "\nError : Variable HXX2SALOME_ROOT_DIR is not set, and hxx2salome didn't find his scripts locally" + usage + fi fi -echo " hxx2salome directory : $gene_dir" -if [ ! -f ${gene_dir}/parse1.awk -o ! -f ${gene_dir}/parse2.awk ] # check if script are found +echo " hxx2salome directory found : $gene_dir" +if [ ! -f ${gene_dir}/parse3.awk -o ! -f ${gene_dir}/template_src.tgz ] # final check then - echo -e "\nError : Variable HXX2SALOME_ROOT_DIR shoud be set, or hxx2salome should be launched localy from bin directory" + echo -e "\nError : scripts parse3.awk or template_src.tgz not present in hxx2salome directory : $gene_dir" usage fi # @@ -499,6 +523,9 @@ fi # CLASS_NAME=`awk '$1 == "class" && $0 !~ /;/ {print $2}' ${hxx_file}|awk -F: '{print $1}'` echo " Name of class :" $CLASS_NAME +class_name=`echo ${CLASS_NAME} | awk '{print tolower($0)}'` +echo class_name = ${class_name} + if [ ! $CLASS_NAME ] then echo -e "\nError:\n Sorry - No class definition was found!\n Please check your header file\n"