[Qa-jenkins-scm] [jenkins.debian.net] 03/06: reproducible: refactor: move another function to html_graphs.sh. correct function descriptions.

Holger Levsen holger at moszumanska.debian.org
Mon Mar 9 19:12:53 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 62cb693a4aaef9b35565a3dfdee26e41e108533d
Author: Holger Levsen <holger at layer-acht.org>
Date:   Mon Mar 9 19:15:57 2015 +0100

    reproducible: refactor: move another function to html_graphs.sh. correct function descriptions.
---
 bin/reproducible_common.sh      | 11 -----------
 bin/reproducible_html_graphs.sh | 24 +++++++++++++++++++++---
 2 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh
index 9a181a3..c096ac3 100755
--- a/bin/reproducible_common.sh
+++ b/bin/reproducible_common.sh
@@ -246,14 +246,3 @@ gen_packages_html() {
 	cd "$CWD"
 }
 
-gather_stats() {
-	COUNT_BAD=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND r.status = \"unreproducible\"")
-	COUNT_UGLY=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND r.status = \"FTBFS\"")
-	COUNT_SOURCELESS=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND r.status = \"404\"")
-	COUNT_NOTFORUS=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND r.status = \"not for us\"")
-	COUNT_BLACKLISTED=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND r.status = \"blacklisted\"")
-	PERCENT_BAD=$(echo "scale=1 ; ($COUNT_BAD*100/$COUNT_TOTAL)" | bc)
-	PERCENT_UGLY=$(echo "scale=1 ; ($COUNT_UGLY*100/$COUNT_TOTAL)" | bc)
-	PERCENT_NOTFORUS=$(echo "scale=1 ; ($COUNT_NOTFORUS*100/$COUNT_TOTAL)" | bc)
-	PERCENT_SOURCELESS=$(echo "scale=1 ; ($COUNT_SOURCELESS*100/$COUNT_TOTAL)" | bc)
-}
diff --git a/bin/reproducible_html_graphs.sh b/bin/reproducible_html_graphs.sh
index 9ddb48a..09c0b14 100755
--- a/bin/reproducible_html_graphs.sh
+++ b/bin/reproducible_html_graphs.sh
@@ -22,7 +22,7 @@ init_html
 gather_stats
 
 #
-# create stats
+# init
 #
 # we only do stats up until yesterday... we also could do today too but not update the db yet...
 DATE=$(date -d "1 day ago" '+%Y-%m-%d')
@@ -36,7 +36,7 @@ TABLE[5]=stats_issues
 TABLE[6]=stats_meta_pkg_state
 
 #
-# gather package + build stats
+# update package + build stats
 #
 RESULT=$(sqlite3 -init ${INIT} ${PACKAGES_DB} "SELECT datum,suite from ${TABLE[0]} WHERE datum = \"$DATE\" AND suite = \"$SUITE\"")
 if [ -z $RESULT ] ; then
@@ -83,7 +83,7 @@ if [ -z $RESULT ] ; then
 fi
 
 #
-# gather notes stats
+# update notes stats
 #
 RESULT=$(sqlite3 -init ${INIT} ${PACKAGES_DB} "SELECT datum from ${TABLE[4]} WHERE datum = \"$DATE\"")
 if [ -z $RESULT ] ; then
@@ -105,6 +105,21 @@ if [ -z $RESULT ] ; then
 fi
 
 #
+# gather packages stats
+#
+gather_stats() {
+	COUNT_BAD=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND r.status = \"unreproducible\"")
+	COUNT_UGLY=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND r.status = \"FTBFS\"")
+	COUNT_SOURCELESS=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND r.status = \"404\"")
+	COUNT_NOTFORUS=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND r.status = \"not for us\"")
+	COUNT_BLACKLISTED=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND r.status = \"blacklisted\"")
+	PERCENT_BAD=$(echo "scale=1 ; ($COUNT_BAD*100/$COUNT_TOTAL)" | bc)
+	PERCENT_UGLY=$(echo "scale=1 ; ($COUNT_UGLY*100/$COUNT_TOTAL)" | bc)
+	PERCENT_NOTFORUS=$(echo "scale=1 ; ($COUNT_NOTFORUS*100/$COUNT_TOTAL)" | bc)
+	PERCENT_SOURCELESS=$(echo "scale=1 ; ($COUNT_SOURCELESS*100/$COUNT_TOTAL)" | bc)
+}
+
+#
 # gather meta pkg stats
 #
 gather_meta_stats() {
@@ -141,6 +156,9 @@ gather_meta_stats() {
 	fi
 }
 
+#
+# update meta pkg stats
+#
 if [ "$SUITE" != "experimental" ] ; then
 	# no meta pkg sets in experimental
 	for i in $(seq 1 ${#META_PKGSET[@]}) ; do

-- 
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