bugfixes, regarding a daily build directory insider the daily build...
authorsonja.mirtitsch%sun.com
Wed, 21 Nov 2001 02:36:33 +0000
changeset 2357 6c0b656f94b3bf44b46b4c5ab203d2f52df984b5
parent 2356 f5d724c825354c0dcd75c54709e8a5a5a5e51d82
child 2358 3ed192219a7aba0695b9cffcd748e473b330f29d
push idunknown
push userunknown
push dateunknown
bugfixes, regarding a daily build directory insider the daily build...
security/nss/tests/qa_stage
--- a/security/nss/tests/qa_stage
+++ b/security/nss/tests/qa_stage
@@ -1,9 +1,9 @@
-#! /bin/sh
+#! /bin/sh 
 ########################################################################
 #
 # /u/sonmi/bin/qa_stage - /u/svbld/bin/init/nss/qa_stage
 #
 # this script is supposed to convert the tinderbox and daily QA files
 # for use on mozilla.org
 #
 # parameters
@@ -64,30 +64,43 @@ qa_stage_init()
     IPLANET_TBX_URL="http://cindercone.red.iplanet.com${TBX_RESULTDIR}"
     IPLANET_DQA_URL="http://cindercone.red.iplanet.com${RESULTDIR}"
 
     MOZ_TBX_URL="ftp://ftp.mozilla.org${MOZ_TBX_RESULTDIR}"
     MOZ_DQA_URL="ftp://ftp.mozilla.org${MOZ_RESULTDIR}"
 
     export IPLANET_TBX_URL IPLANET_DQA_URL MOZ_TBX_URL MOZ_DQA_URL
     STAGE_1=/u/sonmi/tmp/ftp_stage
-    cd $STAGE_1
+    
+    if [ ! -d  $STAGE_1 ] ; then
+        Echo "Staging area daily QA (DQA): $DQA_STAGE does not exist, exit"
+        exit 1
+    fi
+    cd $STAGE_1 || (Echo "Cant cd to $STAGE_1 , exit"; exit)
     rm all.tar* 2>/dev/null
     TBX_STAGE=$STAGE_1/tinderbox
     DQA_STAGE=$STAGE_1/daily_qa/${DAYBUILD}
-
+    Echo "Staging area tbx: $TBX_STAGE"
+    Echo "Staging area daily QA (DQA): $DQA_STAGE"
+    Echo "Resultdir (sourcedir) for daily QA (RESULTDIR): $RESULTDIR"
 }
 
 ################################### qa_stage_dqa ##########################
 # 
 ########################################################################
 qa_stage_dqa()
 {
     Echo "DQA:..."
-    cd $RESULTDIR
+    Echo "Resultdir (sourcedir) for daily QA (RESULTDIR): $RESULTDIR"
+#set -x
+    if [ ! -d  $RESULTDIR ] ; then
+        Echo "Resultdir $RESULTDIR does not exist, can't push daily QA"
+        return
+    fi
+    cd $RESULTDIR || return
     #for w in `find . -name "result*html"`
     for w in `find . -name "result.html"`
     do
         if [ ! -d $DQA_STAGE/`dirname $w` ] ; then
             mkdir -p $DQA_STAGE/`dirname $w`
         fi
         rm $DQA_STAGE/$w 2>/dev/null
         cat $w | reformat_qa >$DQA_STAGE/$w
@@ -104,17 +117,21 @@ qa_stage_dqa()
 
 
 ################################### qa_stage_tbx ##########################
 # 
 ########################################################################
 qa_stage_tbx()
 {
     Echo "tbx: "
-    cd $TBX_RESULTDIR
+    if [ ! -d  $TBX_RESULTDIR ] ; then
+        Echo "TBX_RESULTDIR $TBX_RESULTDIR does not exist"
+        return
+    fi
+    cd $TBX_RESULTDIR || return
     Echo "find from $TBX_FIND_FROM"
     for w in `find $TBX_FIND_FROM  -name "result.html"`
     do
         if [ ! -d $TBX_STAGE/`dirname $w` ] ; then
             mkdir -p $TBX_STAGE/`dirname $w`
         fi
         rm $TBX_STAGE/$w 2>/dev/null
         cat $w | reformat_qa >$TBX_STAGE/$w
@@ -240,29 +257,41 @@ eval_opts()
     shift
   done
 }
 
 qa_stage_init $*
 
 if [ "$DO_CLEAN" = "ON" ] ; then
     Echo "Cleaning old stuff"
-    cd $STAGE_1
-    rm -rf $TBX_STAGE/*
+    if [ ! -d  $STAGE_1 ] ; then
+        Echo "Staging area daily QA (DQA): $DQA_STAGE does not exist, exit"
+        exit 1
+    fi
+    cd $STAGE_1 || (Echo "Cant cd to $STAGE_1 , exit"; exit)
+    if [ -n "$TBX_STAGE" -a -d "$TBX_STAGE" ] ; then
+        rm -rf $TBX_STAGE/*
+    else
+        Echo "nothing here to clean..."
+    fi
 fi
 if [ "$DO_DQA" = "ON" ] ; then
     qa_stage_dqa 
-    if [ "$O_MAIL" = "ON" ] ; then
+    if [ "$O_MAIL" = "ON" -a -f "$DQA_STAGE/result.html" ] ; then
          cat $DQA_STAGE/result.html | /usr/sbin/sendmail $MAILINGLIST 
     fi
 fi
 if [ "$DO_TBX" = "ON" ] ; then
     qa_stage_tbx
 fi
-cd $STAGE_1
+if [ ! -d  $STAGE_1 ] ; then
+    Echo "Staging area daily QA (DQA): $DQA_STAGE does not exist, exit"
+    exit 1
+fi
+cd $STAGE_1 || (Echo "Cant cd to $STAGE_1 , exit"; exit)
 Echo "tar..."
 if [ "$O_SILENT" = "ON" ] ; then
     tar cf all.tar daily_qa        tinderbox
 else
     tar cvf all.tar daily_qa        tinderbox
 fi
 gzip all.tar
 SSH_AUTH_SOCK=`grep SSH_AUTH_SOCK /u/sonmi/.ssh/ssh-agent.info | sed -e 's/setenv SSH_AUTH_SOCK //' -e 's/;//'`