diff options
Diffstat (limited to 'bin/reproducible_nodes_info.sh')
-rwxr-xr-x | bin/reproducible_nodes_info.sh | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/bin/reproducible_nodes_info.sh b/bin/reproducible_nodes_info.sh index 132267cd..a41c0f6a 100755 --- a/bin/reproducible_nodes_info.sh +++ b/bin/reproducible_nodes_info.sh @@ -51,13 +51,12 @@ TMPFILE2=$(mktemp) TMPFILE3=$(mktemp) NOW=$(date -u '+%Y-%m-%d %H:%m') for i in $BUILD_NODES ; do - sqlite3 -init $INIT ${PACKAGES_DB} \ - "SELECT build_date FROM stats_build AS r WHERE ( r.node1=\"$i\" OR r.node2=\"$i\" )" > $TMPFILE1 2>/dev/null + query_db "SELECT build_date FROM stats_build AS r WHERE ( r.node1=\"$i\" OR r.node2=\"$i\" )" > $TMPFILE1 2>/dev/null j=$(wc -l $TMPFILE1|cut -d " " -f1) k=$(cat $TMPFILE1|cut -d " " -f1|sort -u|wc -l) l=$(echo "scale=1 ; ($j/$k)" | bc) echo "$l builds/day ($j/$k) on $i" >> $TMPFILE2 - m=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT count(build_date) FROM stats_build AS r WHERE ( r.node1=\"$i\" OR r.node2=\"$i\" ) AND r.build_date > datetime('$NOW', '-24 hours') " 2>/dev/null) + m=$(query_db "SELECT count(build_date) FROM stats_build AS r WHERE ( r.node1=\"$i\" OR r.node2=\"$i\" ) AND r.build_date > datetime('$NOW', '-24 hours') " 2>/dev/null) echo "$m builds in the last 24h on $i" >> $TMPFILE3 done rm $TMPFILE1 >/dev/null |