summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-03-02 11:58:29 +0100
committerHolger Levsen <holger@layer-acht.org>2015-03-02 11:58:29 +0100
commitac3f31fe7f6f507810d74ea210f00db2864c58b3 (patch)
tree04d685673d535109cdbbe8641991a4f29e04724c
parent9d86783635726286f6c3879a0505f33a4d9efa00 (diff)
downloadjenkins.debian.net-ac3f31fe7f6f507810d74ea210f00db2864c58b3.tar.xz
reproducible: fixup: deal gracefully with no results
-rwxr-xr-xbin/reproducible_html_graphs.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/reproducible_html_graphs.sh b/bin/reproducible_html_graphs.sh
index 6c8fb3a9..f0bba571 100755
--- a/bin/reproducible_html_graphs.sh
+++ b/bin/reproducible_html_graphs.sh
@@ -219,7 +219,8 @@ redo_png() {
WHERE_EXTRA=""
fi
sqlite3 -init ${INIT} -csv ${PACKAGES_DB} "SELECT ${FIELDS[$1]} from ${TABLE[$1]} ${WHERE_EXTRA} ORDER BY datum" >> ${TABLE[$1]}.csv
- if [ -n "$(cat ${TABLE[$1]}.csv)" ] ; then
+ # only generate graph is the query returned data
+ if [ -n "$(tail -1 ${TABLE[$1]}.csv)" ] ; then
/srv/jenkins/bin/make_graph.py ${TABLE[$1]}.csv $2 ${COLOR[$1]} "${MAINLABEL[$1]}" "${YLABEL[$1]}"
mv $2 /var/lib/jenkins/userContent/
fi