From: vsr Date: Thu, 29 Dec 2005 14:25:07 +0000 (+0000) Subject: Fix bug: errors do not print to stderr when check_job() function is called X-Git-Tag: V_3_2_0a1~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1d97c51509300fc41d8b2fbe31cb40ffd6f44bec;p=tools%2Finstall.git Fix bug: errors do not print to stderr when check_job() function is called --- diff --git a/config_files/build.csh b/config_files/build.csh index 9334e9a..a9f0a44 100755 --- a/config_files/build.csh +++ b/config_files/build.csh @@ -1,7 +1,7 @@ #! /bin/csh -f ################################################################################################## # Name : build.csh -# Description: Build and install SALOME2 modules from sources +# Description: Build and install SALOME modules from sources # Author : Vadim SANDLER (VSR), Open CASCADE S.A. # Created : 27.01.2005 ################################################################################################## diff --git a/config_files/common.sh b/config_files/common.sh index 395a2de..f48202c 100755 --- a/config_files/common.sh +++ b/config_files/common.sh @@ -18,7 +18,6 @@ export DELIM="------" export SHRC="salome.sh" export CSHRC="salome.csh" -export DEBUG=1 #this function takes several parameters #first parameter contains descriptor of output file @@ -29,19 +28,21 @@ check_job() { out=$1 shift - echo -e "`pwd` -> $* >> $out" - if [ $DEBUG == 0 ] ; then - $* | tee $out + errfile=/tmp/errlog + if [ -n "$INSTALL_WORK" ] ; then errfile=$INSTALL_WORK/errlog; fi + cmd="`pwd` -> $*" + if [ "$out" != "1" ] ; then cmd="$cmd >> $out" ; fi + echo -e $cmd + if [ "$out" != "1" ] ; then + $* >> $out 2>$errfile else - if [ $out == "1" ] ; then $* - else - $* >> $out 2>&1 - fi fi if [ "$?" -ne "0" ] ; then if [ $out != "1" ] ; then cat $out + cat $errfile >&2 + cat $errfile >> $out fi # VSR : 10/11/05: disable answer mode ==> #echo -n " " >&2 @@ -129,7 +130,8 @@ done # 1. first dump all environment files into the $SHRC file product_sequence="$2" for i in $product_sequence ; do - cat ${install_work}/env_${i}.sh >> ${install_work}/$SHRC 2>/dev/null + env_file=${install_work}/env_${i}.sh + ( test -e $env_file && cat $env_file >> ${install_work}/$SHRC 2>/dev/null ) done # 2. writing global functions to _salome.sh file