summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_html_dashboard.sh
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@debian.org>2017-01-19 14:42:05 +0100
committerHolger Levsen <holger@layer-acht.org>2017-01-19 14:45:19 +0100
commitf021dcca06d0e62306e271bf65f4495b60023841 (patch)
tree324808399550af5e3b2d277e3bc008408413746f /bin/reproducible_html_dashboard.sh
parente199cfa0174a1421db1489eb135247c0980acc7d (diff)
downloadjenkins.debian.net-f021dcca06d0e62306e271bf65f4495b60023841.tar.xz
reproducible debian: dashboard: avoid printing disclaimer when stats are not even computed
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin/reproducible_html_dashboard.sh')
-rwxr-xr-xbin/reproducible_html_dashboard.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/reproducible_html_dashboard.sh b/bin/reproducible_html_dashboard.sh
index e6fe61f7..faba215e 100755
--- a/bin/reproducible_html_dashboard.sh
+++ b/bin/reproducible_html_dashboard.sh
@@ -304,12 +304,12 @@ _average_builds_per_day() {
local DAY_DIFFS="$(( ($(date -d "$DATE" +%s) - $(date -d "$OLDEST_BUILD" +%s)) / (60*60*24) ))"
local DISCLAIMER=""
local TIMESPAN="$TIMESPAN_RAW"
- if [ $DAY_DIFFS -lt $TIMESPAN ]; then
- # this is a new architecture, there are fewer days to compare to.
- DISCLAIMER=" <span style=\"font-size: 0.8em;\">(in the last $DAY_DIFFS days)</span>"
- TIMESPAN=$DAY_DIFF
- fi
if [ $DAY_DIFFS -ge $MIN_DAYS ]; then
+ if [ $DAY_DIFFS -lt $TIMESPAN ]; then
+ # this is a new architecture, there are fewer days to compare to.
+ DISCLAIMER=" <span style=\"font-size: 0.8em;\">(in the last $DAY_DIFFS days)</span>"
+ TIMESPAN=$DAY_DIFFS
+ fi
# find stats for since the day before $TIMESPAN_RAW days ago,
# since no stats exist for today yet.
local TIMESPAN="$(echo $TIMESPAN-1|bc)"
@@ -318,7 +318,7 @@ _average_builds_per_day() {
RESULT=$(query_db "SELECT COUNT(r.build_date) FROM stats_build AS r WHERE r.build_date > '$TIMESPAN_DATE' AND r.architecture='$ARCH'")
RESULT="$(echo $RESULT/$TIMESPAN|bc)"
else
- # very new arch with too few resulsts to care about stats
+ # very new arch with too few results to care about stats
RESULT="&nbsp;"
fi
write_page "<td>${RESULT}${DISCLAIMER}</td>"