[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible: only update the bugs_stats table if we got data from the bts

Holger Levsen holger at moszumanska.debian.org
Mon May 25 07:42:14 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit f954a2bcb6510e37e060990f9f2cc793962c2a31
Author: Holger Levsen <holger at layer-acht.org>
Date:   Mon May 25 09:42:09 2015 +0200

    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 dab37d1..93280f6 100755
--- a/bin/reproducible_html_graphs.sh
+++ b/bin/reproducible_html_graphs.sh
@@ -4,7 +4,7 @@
 #         © 2015 Mattia Rizzolo <mattia at mapreri.org>
 # 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 at 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
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list