[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible: take more care to recreate the graphs when new data is available

Holger Levsen holger at moszumanska.debian.org
Thu Dec 10 09:36:40 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 2849b40208d98d07fef8f2c3a41f217b8c894ae4
Author: Holger Levsen <holger at layer-acht.org>
Date:   Thu Dec 10 10:36:11 2015 +0100

    reproducible: take more care to recreate the graphs when new data is available
---
 bin/reproducible_html_dashboard.sh | 14 ++++++++------
 bin/reproducible_html_pkg_sets.sh  |  2 +-
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/bin/reproducible_html_dashboard.sh b/bin/reproducible_html_dashboard.sh
index 5739537..ae174dd 100755
--- a/bin/reproducible_html_dashboard.sh
+++ b/bin/reproducible_html_dashboard.sh
@@ -17,6 +17,8 @@ common_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')
 FORCE_DATE=$(date -d "3 days ago" '+%Y-%m-%d')
+OLD_DUMMY_FILE=$(mktemp -t reproducible-dashboard-XXXXXXXX)
+touch -d "$DATE 00:00 UTC" $OLD_DUMMY_FILE
 NOTES_GIT_PATH="/var/lib/jenkins/jobs/reproducible_html_notes/workspace"
 
 # variables related to the stats we update
@@ -140,7 +142,7 @@ update_suite_arch_stats() {
 			# force regeneration of the image if it exists
 			if [ -f $BASE/$PREFIX/${TABLE[$i]}.png ] ; then
 				echo "Touching $PREFIX/${TABLE[$i]}.png..."
-				touch -d "$FORCE_DATE 00:00" $BASE/$PREFIX/${TABLE[$i]}.png
+				touch -d "$FORCE_DATE 00:00 UTC" $BASE/$PREFIX/${TABLE[$i]}.png
 			fi
 		done
 	fi
@@ -236,7 +238,7 @@ update_bug_stats() {
 			local i=0
 			for i in 3 7 8 9 ; do
 				echo "Touching ${TABLE[$i]}.png..."
-				touch -d "$FORCE_DATE 00:00" $BASE/${TABLE[$i]}.png
+				touch -d "$FORCE_DATE 00:00 UTC" $BASE/${TABLE[$i]}.png
 			done
 		fi
 	fi
@@ -386,7 +388,7 @@ create_suite_arch_stats_page() {
 	write_page " <a href=\"/$SUITE/$ARCH/${TABLE[0]}.png\"><img src=\"/$SUITE/$ARCH/${TABLE[0]}.png\" alt=\"${MAINLABEL[0]}\"></a>"
 	for i in 0 2 ; do
 		# recreate png once a day
-		if [ ! -f $BASE/$SUITE/$ARCH/${TABLE[$i]}.png ] || [ ! -z $(find $BASE/$SUITE/$ARCH -maxdepth 1 -mtime +0 -name ${TABLE[$i]}.png) ] ; then
+		if [ ! -f $BASE/$SUITE/$ARCH/${TABLE[$i]}.png ] || [ $OLD_DUMMY_FILE -nt $BASE/$SUITE/$ARCH/${TABLE[$i]}.png ] ; then
 			create_png_from_table $i $SUITE/$ARCH/${TABLE[$i]}.png
 		fi
 	done
@@ -461,7 +463,7 @@ create_dashboard_page() {
 	for i in 8 9 3 7 4 5 ; do
 		write_page " <a href=\"/${TABLE[$i]}.png\"><img src=\"/${TABLE[$i]}.png\" class="halfview" alt=\"${MAINLABEL[$i]}\"></a>"
 		# redo pngs once a day
-		if [ ! -f $BASE/${TABLE[$i]}.png ] || [ ! -z $(find $BASE -maxdepth 1 -mtime +0 -name ${TABLE[$i]}.png) ] ; then
+		if [ ! -f $BASE/${TABLE[$i]}.png ] || [ $OLD_DUMMY_FILE -nt $BASE/${TABLE[$i]}.png ] ; then
 			create_png_from_table $i ${TABLE[$i]}.png
 		fi
 	done
@@ -473,7 +475,7 @@ create_dashboard_page() {
 	write_page " <a href=\"/${TABLE[1]}_$ARCH.png\"><img src=\"/${TABLE[1]}_$ARCH.png\" alt=\"${MAINLABEL[$i]}\"></a>"
 	# redo arch specific pngs once a day
 	for ARCH in ${ARCHS} ; do
-		if [ ! -f $BASE/${TABLE[1]}_$ARCH.png ] || [ ! -z $(find $BASE -maxdepth 1 -mtime +0 -name ${TABLE[1]}_$ARCH.png) ] ; then
+		if [ ! -f $BASE/${TABLE[1]}_$ARCH.png ] || [ $OLD_DUMMY_FILE -nt $BASE/${TABLE[1]}_$ARCH.png ] ; then
 				create_png_from_table 1 ${TABLE[1]}_$ARCH.png
 		fi
 	done
@@ -524,4 +526,4 @@ done
 ARCH="amd64"
 SUITE="unstable"
 create_dashboard_page
-
+rm -f $OLD_DUMMY_FILE >/dev/null
diff --git a/bin/reproducible_html_pkg_sets.sh b/bin/reproducible_html_pkg_sets.sh
index 6a2b024..f861808 100755
--- a/bin/reproducible_html_pkg_sets.sh
+++ b/bin/reproducible_html_pkg_sets.sh
@@ -81,7 +81,7 @@ update_meta_pkg_stats() {
 				echo "Updating meta pkg set stats for ${META_PKGSET[$1]} in $SUITE on $DATE."
 			fi
 			echo "Touching $SUITE/$ARCH/${TABLE[6]}_${META_PKGSET[$i]}.png..."
-			touch -d "$FORCE_DATE 00:00" $BASE/$SUITE/$ARCH/${TABLE[6]}_${META_PKGSET[$i]}.png
+			touch -d "$FORCE_DATE 00:00 UTC" $BASE/$SUITE/$ARCH/${TABLE[6]}_${META_PKGSET[$i]}.png
 		fi
 	done
 }

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