From 486782e33fb23b79c967d4e496d08c5784a9c30c Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 21 Apr 2010 14:18:43 +0200 Subject: [PATCH] upgradeFromGit.sh : Added progress bar during documentation build. --- upgradeFromGit.sh | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/upgradeFromGit.sh b/upgradeFromGit.sh index f1ebb434..aa32fade 100755 --- a/upgradeFromGit.sh +++ b/upgradeFromGit.sh @@ -239,19 +239,32 @@ then read a if [ "$a" == "y" -o "$a" == "Y" ] then - msg "-> Build the doc : " -en - cd $ROOT_DIR/doc >> $LOG_FILE 2>&1 && make >> $LOG_FILE 2>&1 && cd - >> $LOG_FILE 2>&1 - if [ $? -gt 0 ] - then - msg "Error" - exit 1 - else - msg "Ok" - fi + msg "-> Build the doc : " -en + cd $ROOT_DIR/doc + + make clean >> $LOG_FILE 2>&1 + make >> $LOG_FILE 2>&1 & + + export P=$! + + trap exitwhell INT + + function exitwhell() { + [ -n "$P" ] && kill -9 $P 2> /dev/null + echo " -- INT -- " + exit 1 + } + + while [ -d /proc/$P ] + do + echo -n . + sleep 1 + done + echo done. - if [ -n "$EXPORT_DOC_DIR" ] - then - $ROOT_DIR/buildDocExports.sh - fi - fi + if [ -n "$EXPORT_DOC_DIR" ] + then + $ROOT_DIR/buildDocExports.sh + fi + fi fi