[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 3 commits: reproducible Archlinux: refactoring

Holger Levsen gitlab at salsa.debian.org
Fri Oct 5 03:00:39 BST 2018


Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
d358259d by Holger Levsen at 2018-10-05T01:25:00Z
reproducible Archlinux: refactoring

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -
206107c3 by Holger Levsen at 2018-10-05T01:58:35Z
reproducible Archlinux: whitespace changes

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -
abbc4af2 by Holger Levsen at 2018-10-05T02:00:13Z
reproducible Archlinux: refactoring, DRY also in output

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


2 changed files:

- bin/reproducible_common.sh
- bin/reproducible_html_archlinux.sh


Changes:

=====================================
bin/reproducible_common.sh
=====================================
@@ -566,7 +566,7 @@ publish_page() {
 	else
 		TARGET=$1/$PAGE
 	fi
-	cp -v $PAGE $BASE/$TARGET
+	echo "$(date -u) - $(cp -v $PAGE $BASE/$TARGET)"
 	rm $PAGE
 	echo "$(date -u) - enjoy $REPRODUCIBLE_URL/$TARGET"
 }


=====================================
bin/reproducible_html_archlinux.sh
=====================================
@@ -156,7 +156,7 @@ repostats(){
 }
 
 archlinux_page_header(){
-	echo "$(date -u) - starting to build $PAGE"
+	echo "$(date -u) - starting to write $PAGE"
 	cat > $PAGE <<- EOF
 	<!DOCTYPE html>
 	<html lang="en-US">
@@ -179,7 +179,6 @@ archlinux_page_header(){
 archlinux_page_footer(){
 	write_page "</div></div>"
 	write_page_footer 'Arch Linux'
-	echo "$(date -u) - enjoy $REPRODUCIBLE_URL/archlinux/$PAGE"
 	publish_page archlinux
 }
 
@@ -218,16 +217,22 @@ repository_pages(){
 	for REPOSITORY in $ARCHLINUX_REPOS ; do
 		PAGE=$REPOSITORY.html
 		TITLE="Reproducible archlinux $REPOSITORY ?!"
-		echo "$(date -u) - starting to write page for $REPOSITORY'."
 		archlinux_page_header
 		archlinux_repostats_table
 		SUITE="archlinux_$REPOSITORY"
-		TESTED=$(query_db "SELECT count(*) FROM sources AS s JOIN results AS r ON s.id=r.package_id
-				WHERE s.architecture='x86_64' AND s.suite='$SUITE';")
+		TESTED=$(query_db "SELECT count(*) FROM sources AS s
+					JOIN results AS r
+					ON s.id=r.package_id
+					WHERE s.architecture='x86_64'
+					AND s.suite='$SUITE';")
 		write_page "<h2>$TESTED packages in repository $REPOSITORY</h2>"
 		include_pkg_table_header_in_page
-		REPO_PKGS=$(query_db "SELECT s.name FROM sources AS s JOIN results AS r ON s.id=r.package_id
-				WHERE s.architecture='x86_64' AND s.suite='$SUITE' ORDER BY r.status,s.name")
+		REPO_PKGS=$(query_db "SELECT s.name FROM sources
+				AS s JOIN results AS r
+				ON s.id=r.package_id
+				WHERE s.architecture='x86_64'
+				AND s.suite='$SUITE'
+				ORDER BY r.status,s.name")
 		for SRCPACKAGE in $REPO_PKGS ; do
 			include_pkg_html_in_page
 		done
@@ -240,15 +245,18 @@ state_pages(){
 	for STATE in FTBFS FTBR DEPWAIT 404 GOOD BLACKLISTED UNKNOWN ; do
 		PAGE=state_$STATE.html
 		TITLE="Reproducible archlinux, packages in state $STATE"
-		echo "$(date -u) - starting to write page for state $STATE'."
 		archlinux_page_header
 		archlinux_repostats_table
-		TESTED=$(query_db "SELECT count(*) FROM sources AS s JOIN results AS r ON s.id=r.package_id
-				WHERE s.architecture='x86_64' AND r.status LIKE '$STATE%';")
+		TESTED=$(query_db "SELECT count(*) FROM sources AS s
+				JOIN results AS r
+				ON s.id=r.package_id
+				WHERE s.architecture='x86_64'
+				AND r.status LIKE '$STATE%';")
 		if [ "$STATE" = "UNKNOWN" ] ; then
 			# untested packages are also state UNKNOWN...
 			UNTESTED=$(query_db "SELECT count(s.name) FROM sources AS s
-					WHERE s.architecture='x86_64' AND s.id NOT IN (SELECT package_id FROM results)")
+					WHERE s.architecture='x86_64'
+					AND s.id NOT IN (SELECT package_id FROM results)")
 			if [ $UNTESTED -ne 0 ] ; then
 				let TESTED=$TESTED+$UNTESTED
 			fi
@@ -257,15 +265,23 @@ state_pages(){
 		include_pkg_table_header_in_page
 		for REPOSITORY in $ARCHLINUX_REPOS ; do
 			SUITE="archlinux_$REPOSITORY"
-			STATE_PKGS=$(query_db "SELECT s.name FROM sources AS s JOIN results AS r ON s.id=r.package_id
-					WHERE s.architecture='x86_64' AND s.suite='$SUITE' AND r.status LIKE '$STATE%' ORDER BY r.status,s.name")
+			STATE_PKGS=$(query_db "SELECT s.name FROM sources AS s
+					JOIN results AS r
+					ON s.id=r.package_id
+					WHERE s.architecture='x86_64'
+					AND s.suite='$SUITE'
+					AND r.status LIKE '$STATE%'
+					ORDER BY r.status,s.name")
 			for SRCPACKAGE in ${STATE_PKGS} ; do
 				include_pkg_html_in_page
 			done
 			if [ "$STATE" = "UNKNOWN" ] ; then
 				# untested packages are also state UNKNOWN...
 				STATE_PKGS=$(query_db "SELECT s.name FROM sources AS s
-					WHERE s.architecture='x86_64' AND s.suite='$SUITE' AND s.id NOT IN (SELECT package_id FROM results) ORDER BY s.name")
+					WHERE s.architecture='x86_64'
+					AND s.suite='$SUITE'
+					AND s.id NOT IN (SELECT package_id FROM results)
+					ORDER BY s.name")
 				for SRCPACKAGE in ${STATE_PKGS} ; do
 					include_pkg_html_in_page
 				done
@@ -282,30 +298,43 @@ repository_state_pages(){
 		for STATE in FTBFS FTBR DEPWAIT 404 GOOD BLACKLISTED UNKNOWN ; do
 			PAGE=state_${REPOSITORY}_$STATE.html
 			TITLE="Reproducible archlinux, packages in $REPOSITORY in state $STATE"
-			echo "$(date -u) - starting to write page for packages in $REPOSITORY in state $STATE'."
 			archlinux_page_header
 			archlinux_repostats_table
-			TESTED=$(query_db "SELECT count(*) FROM sources AS s JOIN results AS r ON s.id=r.package_id
-					WHERE s.architecture='x86_64' AND s.suite='$SUITE' AND r.status LIKE '$STATE%';")
+			TESTED=$(query_db "SELECT count(*) FROM sources AS s
+					JOIN results AS r
+					ON s.id=r.package_id
+					WHERE s.architecture='x86_64'
+					AND s.suite='$SUITE'
+					AND r.status LIKE '$STATE%';")
 			if [ "$STATE" = "UNKNOWN" ] ; then
 				# untested packages are also state UNKNOWN...
 				UNTESTED=$(query_db "SELECT count(s.name) FROM sources AS s
-						WHERE s.architecture='x86_64' AND s.suite='$SUITE' AND s.id NOT IN (SELECT package_id FROM results)")
+						WHERE s.architecture='x86_64'
+						AND s.suite='$SUITE'
+						AND s.id NOT IN (SELECT package_id FROM results)")
 				if [ $UNTESTED -ne 0 ] ; then
 					let TESTED=$TESTED+$UNTESTED
 				fi
 			fi
 			write_page "<h2>$TESTED packages in $REPOSITORY in $STATE state</h2>"
 			include_pkg_table_header_in_page
-			STATE_PKGS=$(query_db "SELECT s.name FROM sources AS s JOIN results AS r ON s.id=r.package_id
-					WHERE s.architecture='x86_64' AND s.suite='$SUITE' AND r.status LIKE '$STATE%' ORDER BY r.status,s.name")
+			STATE_PKGS=$(query_db "SELECT s.name FROM sources AS s
+					JOIN results AS r
+					ON s.id=r.package_id
+					WHERE s.architecture='x86_64'
+					AND s.suite='$SUITE'
+					AND r.status LIKE '$STATE%'
+					ORDER BY r.status,s.name")
 			for SRCPACKAGE in ${STATE_PKGS} ; do
 				include_pkg_html_in_page
 			done
 			if [ "$STATE" = "UNKNOWN" ] ; then
 				# untested packages are also state UNKNOWN...
 				STATE_PKGS=$(query_db "SELECT s.name FROM sources AS s
-					WHERE s.architecture='x86_64' AND s.suite='$SUITE' AND s.id NOT IN (SELECT package_id FROM results) ORDER BY s.name")
+					WHERE s.architecture='x86_64'
+					AND s.suite='$SUITE'
+					AND s.id NOT IN (SELECT package_id FROM results)
+					ORDER BY s.name")
 				for SRCPACKAGE in ${STATE_PKGS} ; do
 					include_pkg_html_in_page
 				done
@@ -319,17 +348,18 @@ repository_state_pages(){
 recent_builds(){
 	PAGE=recent_builds.html
 	TITLE="Reproducible archlinux, builds in the last 24h"
-	echo "$(date -u) - starting to write page recent builds."
 	archlinux_page_header
 	archlinux_repostats_table
 	write_page "<h2>Recent builds of Archlinux packages in the last 24h</h2>"
 	include_pkg_table_header_in_page
 	MAXDATE="$(date -u +'%Y-%m-%d %H:%M' -d '24 hours ago')"
-	STATE_PKGS=$(query_db "SELECT s.name FROM sources AS s JOIN results AS r ON s.id=r.package_id
-			WHERE s.architecture='x86_64'
-			AND r.build_date > '$MAXDATE'
-			ORDER BY r.build_date
-			DESC")
+	STATE_PKGS=$(query_db "SELECT s.name FROM sources AS s
+				JOIN results AS r
+				ON s.id=r.package_id
+				WHERE s.architecture='x86_64'
+				AND r.build_date > '$MAXDATE'
+				ORDER BY r.build_date
+				DESC")
 	for SRCPACKAGE in ${STATE_PKGS} ; do
 		include_pkg_html_in_page
 	done



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/compare/9aa0fffeee5d1feda808352bb7d42d8a83205d9e...abbc4af2838a7d927f9f4d9299a757b65453a96d

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/compare/9aa0fffeee5d1feda808352bb7d42d8a83205d9e...abbc4af2838a7d927f9f4d9299a757b65453a96d
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20181005/e32e1a22/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list