[Qa-jenkins-scm] [jenkins.debian.net] 01/06: reproducible: refactor: these variables are only needed by html_graphs.sh now
Holger Levsen
holger at moszumanska.debian.org
Mon Mar 9 19:12:52 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 d49196b9fff1fc2de34d185967989c4d544364b2
Author: Holger Levsen <holger at layer-acht.org>
Date: Mon Mar 9 19:10:06 2015 +0100
reproducible: refactor: these variables are only needed by html_graphs.sh now
---
bin/reproducible_common.sh | 9 ---------
bin/reproducible_html_graphs.sh | 8 ++++++++
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh
index a54b2ee..e46b776 100755
--- a/bin/reproducible_common.sh
+++ b/bin/reproducible_common.sh
@@ -91,15 +91,6 @@ init_html() {
SPOKENTARGET["suite_stats"]="suite: $SUITE"
SPOKENTARGET["repo_stats"]="repositories overview"
SPOKENTARGET["stats"]="reproducible stats"
- # FIXME: this can probably all go into html_graph.sh now...: query some data we need everywhere
- AMOUNT=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT count(*) FROM sources WHERE suite=\"${SUITE}\"")
- COUNT_TOTAL=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(*) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite=\"${SUITE}\"")
- COUNT_GOOD=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(*) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite=\"${SUITE}\" AND r.status=\"reproducible\"")
-
- PERCENT_TOTAL=$(echo "scale=1 ; ($COUNT_TOTAL*100/$AMOUNT)" | bc)
- if [ -z "${PERCENT_TOTAL}" ]; then PERCENT_TOTAL=0; fi
- PERCENT_GOOD=$(echo "scale=1 ; ($COUNT_GOOD*100/$COUNT_TOTAL)" | bc)
- if [ -z "${PERCENT_GOOD}" ]; then PERCENT_GOOD=0; fi
}
write_page() {
diff --git a/bin/reproducible_html_graphs.sh b/bin/reproducible_html_graphs.sh
index b458c7c..9ddb48a 100755
--- a/bin/reproducible_html_graphs.sh
+++ b/bin/reproducible_html_graphs.sh
@@ -295,6 +295,14 @@ write_usertag_table() {
fi
}
+AMOUNT=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT count(*) FROM sources WHERE suite=\"${SUITE}\"")
+COUNT_TOTAL=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(*) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite=\"${SUITE}\"")
+COUNT_GOOD=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(*) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite=\"${SUITE}\" AND r.status=\"reproducible\"")
+PERCENT_TOTAL=$(echo "scale=1 ; ($COUNT_TOTAL*100/$AMOUNT)" | bc)
+if [ -z "${PERCENT_TOTAL}" ]; then PERCENT_TOTAL=0; fi
+PERCENT_GOOD=$(echo "scale=1 ; ($COUNT_GOOD*100/$COUNT_TOTAL)" | bc)
+if [ -z "${PERCENT_GOOD}" ]; then PERCENT_GOOD=0; fi
+
VIEW=suite_stats
PAGE=index_${VIEW}.html
echo "$(date) - starting to write $PAGE page."
--
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