summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-05-25 09:42:09 +0200
committerHolger Levsen <holger@layer-acht.org>2015-05-25 09:42:09 +0200
commitf954a2bcb6510e37e060990f9f2cc793962c2a31 (patch)
tree7fe5c4eb5a73ff58da145350665183064fd17c19 /bin
parenta036d57e34ab521c74a9f8766ff34ec31f84ef4f (diff)
downloadjenkins.debian.net-f954a2bcb6510e37e060990f9f2cc793962c2a31.tar.xz
reproducible: only update the bugs_stats table if we got data from the bts
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_html_graphs.sh20
1 files 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 <mattia@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@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
}