From e8bfdbd3163dbb33b690d8a3392fe826748ce40d Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Fri, 9 Jan 2015 17:08:50 +0100 Subject: reproducible: give percentages for meta pkg sets states --- bin/reproducible_html_graphs.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bin/reproducible_html_graphs.sh b/bin/reproducible_html_graphs.sh index 555b35b7..62098437 100755 --- a/bin/reproducible_html_graphs.sh +++ b/bin/reproducible_html_graphs.sh @@ -87,6 +87,11 @@ gather_meta_stats() { COUNT_META_BAD=$(sqlite3 -init ${INIT} ${PACKAGES_DB} "SELECT count(status) from source_packages WHERE status = 'unreproducible' AND date(build_date)<='$DATE' AND $META_WHERE;") COUNT_META_UGLY=$(sqlite3 -init ${INIT} ${PACKAGES_DB} "SELECT count(status) from source_packages WHERE status = 'FTBFS' AND date(build_date)<='$DATE' AND $META_WHERE;") COUNT_META_REST=$(sqlite3 -init ${INIT} ${PACKAGES_DB} "SELECT count(status) from source_packages WHERE (status != 'FTBFS' AND status != 'unreproducible' AND status != 'reproducible') AND date(build_date)<='$DATE' AND $META_WHERE;") + let META_ALL=COUNT_META_GOOD+COUNT_META_BAD+COUNT_META_UGLY+COUNT_META_REST + PERCENT_META_GOOD=$(echo "scale=1 ; ($COUNT_META_GOOD*100/$META_ALL)" | bc) + PERCENT_META_BAD=$(echo "scale=1 ; ($COUNT_META_BAD*100/$META_ALL)" | bc) + PERCENT_META_UGLY=$(echo "scale=1 ; ($COUNT_META_UGLY*100/$META_ALL)" | bc) + PERCENT_META_REST=$(echo "scale=1 ; ($COUNT_META_REST*100/$META_ALL)" | bc) META_GOOD=$(sqlite3 -init ${INIT} ${PACKAGES_DB} "SELECT name from source_packages WHERE status = 'reproducible' AND date(build_date)<='$DATE' AND $META_WHERE;") META_BAD=$(sqlite3 -init ${INIT} ${PACKAGES_DB} "SELECT name from source_packages WHERE status = 'unreproducible' AND date(build_date)<='$DATE' AND $META_WHERE;") META_UGLY=$(sqlite3 -init ${INIT} ${PACKAGES_DB} "SELECT name from source_packages WHERE status = 'FTBFS' AND date(build_date)<='$DATE' AND $META_WHERE;") @@ -275,20 +280,20 @@ for i in $(seq 1 ${#META_PKGSET[@]}) ; do write_page "
The package set '${META_PKGSET[$i]}' consists of:
" set_icon reproducible write_icon - write_page "$COUNT_META_GOOD packages successfully built reproducibly:" + write_page "$COUNT_META_GOOD packages ($PERCENT_META_GOOD%) successfully built reproducibly:" force_package_targets $META_GOOD link_packages $META_GOOD write_page "
" set_icon unreproducible with write_icon - write_page "$COUNT_META_BAD packages failed to built reproducibly:" + write_page "$COUNT_META_BAD ($PERCENT_META_BAD%) packages failed to built reproducibly:" force_package_targets $META_BAD link_packages $META_BAD write_page "
" if [ $COUNT_META_UGLY -gt 0 ] ; then set_icon FTBFS write_icon - write_page "$COUNT_META_UGLY packages failed to build from source:" + write_page "$COUNT_META_UGLY ($PERCENT_META_UGLY%) packages failed to build from source:" force_package_targets $META_UGLY link_packages $META_UGLY write_page "
" @@ -300,7 +305,7 @@ for i in $(seq 1 ${#META_PKGSET[@]}) ; do write_icon set_icon 404 write_icon - write_page "$COUNT_META_REST packages are either blacklisted, not for us or cannot be downloaded:" + write_page "$COUNT_META_REST ($PERCENT_META_REST%) packages are either blacklisted, not for us or cannot be downloaded:" force_package_targets $META_REST link_packages $META_REST write_page "
" -- cgit v1.2.3-70-g09d2