From f954a2bcb6510e37e060990f9f2cc793962c2a31 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 25 May 2015 09:42:09 +0200 Subject: reproducible: only update the bugs_stats table if we got data from the bts --- bin/reproducible_html_graphs.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/bin/reproducible_html_graphs.sh b/bin/reproducible_html_graphs.sh index dab37d12..93280f64 100755 --- a/bin/reproducible_html_graphs.sh +++ b/bin/reproducible_html_graphs.sh @@ -4,7 +4,7 @@ # © 2015 Mattia Rizzolo # released under the GPLv=2 -DEBUG=true +DEBUG=false . /srv/jenkins/bin/common-functions.sh common_init "$@" @@ -243,6 +243,7 @@ update_bug_stats() { echo "Updating bug stats for $DATE." declare -a DONE declare -a OPEN + GOT_BTS_RESULTS=false SQL="INSERT INTO ${TABLE[3]} VALUES (\"$DATE\" " for TAG in $USERTAGS ; do OPEN[$TAG]=$(bts select usertag:$TAG users:reproducible-builds@lists.alioth.debian.org status:open status:forwarded 2>/dev/null|wc -l) @@ -254,17 +255,22 @@ update_bug_stats() { echo "Open: ${OPEN[$TAG]}" echo "Done: ${DONE[$TAG]}" exit 1 + elif [ $DONE[$TAG] !=0 ] || [ $OPEN[$TAG] !=0 ] ; then + GOT_BTS_RESULTS=true fi SQL="$SQL, ${OPEN[$TAG]}, ${DONE[$TAG]}" done SQL="$SQL)" echo $SQL - sqlite3 -init ${INIT} ${PACKAGES_DB} "$SQL" - # force regeneration of the image - echo "Touching ${TABLE[3]}.png..." - touch -d "$FORCE_DATE 00:00" $BASE/${TABLE[3]}.png - echo "Touching ${TABLE[7]}.png..." - touch -d "$FORCE_DATE 00:00" $BASE/${TABLE[7]}.png + if $GOT_BTS_RESULTS ; then + echo "Updating ${PACKAGES_DB} with bug stats for $DATE." + sqlite3 -init ${INIT} ${PACKAGES_DB} "$SQL" + # force regeneration of the image + echo "Touching ${TABLE[3]}.png..." + touch -d "$FORCE_DATE 00:00" $BASE/${TABLE[3]}.png + echo "Touching ${TABLE[7]}.png..." + touch -d "$FORCE_DATE 00:00" $BASE/${TABLE[7]}.png + fi fi } -- cgit v1.2.3-54-g00ecf