[Qa-jenkins-scm] [jenkins.debian.net] 05/05: reproducible: common.sh: drop that set_linktarget nonsense, and teach link_packages to query the homonym function of its python brother

Holger Levsen holger at moszumanska.debian.org
Wed Apr 22 07:40:22 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 52b794f0f6c57d93e2a959b8b4abc3d4c7563dc4
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Tue Apr 21 23:20:07 2015 +0200

    reproducible: common.sh: drop that set_linktarget nonsense, and teach link_packages to query the homonym function of its python brother
---
 bin/reproducible_common.sh      | 31 +++++++++++++++----------------
 bin/reproducible_html_graphs.sh |  4 ----
 2 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh
index e26c7a8..c1769e7 100755
--- a/bin/reproducible_common.sh
+++ b/bin/reproducible_common.sh
@@ -49,7 +49,6 @@ USERTAGS="toolchain infrastructure timestamps fileordering buildpath username ho
 
 # we only need them for html creation but we cannot declare them in a function
 declare -A SPOKENTARGET
-declare -A LINKTARGET
 
 NOTES_PATH=/var/lib/jenkins/userContent/notes
 ISSUES_PATH=/var/lib/jenkins/userContent/issues
@@ -261,23 +260,23 @@ set_package_class() {
 	fi
 }
 
-set_linktarget() {
-	cd "$BASE"
-	for PKG in $@ ; do
-		if [ -f $RB_PATH/$SUITE/$ARCH/$PKG.html ] ; then
-			LINKTARGET[$PKG]=$(python3 -c "from reproducible_common import link_package ; \
-							print(link_package('$PKG', '$SUITE', '$ARCH'))")
-		else
-			LINKTARGET[$PKG]="$PKG"
-		fi
-	done
-	cd - > /dev/null
-}
-
 link_packages() {
-	for PKG in $@ ; do
-		write_page " ${LINKTARGET[$PKG]}"
+	cd /srv/jenkins/bin
+	for (( i=1; i<$#+1; i=i+400 )) ; do
+		local string='['
+		local delimiter=''
+		for (( j=0; j<400; j++)) ; do
+			local item=$(( $j+$i ))
+			if (( $item < $#+1 )) ; then
+				local string+="${delimiter}\"${!item}\""
+				local delimiter=','
+			fi
+		done
+		local string+=']'
+		write_page " $(python3 -c "from reproducible_common import link_packages; \
+				print(link_packages(${string}, '$SUITE', '$ARCH'))" 2> /dev/null)"
 	done
+	cd - > /dev/null
 }
 
 gen_packages_html() {
diff --git a/bin/reproducible_html_graphs.sh b/bin/reproducible_html_graphs.sh
index f29e270..09ac89b 100755
--- a/bin/reproducible_html_graphs.sh
+++ b/bin/reproducible_html_graphs.sh
@@ -436,20 +436,17 @@ create_pkg_sets_page() {
 			set_icon reproducible
 			write_icon
 			write_page "$COUNT_META_GOOD packages ($PERCENT_META_GOOD%) successfully built reproducibly:"
-			set_linktarget $META_GOOD
 			link_packages $META_GOOD
 			write_page "<br />"
 			set_icon unreproducible
 			write_icon
 			write_page "$COUNT_META_BAD ($PERCENT_META_BAD%) packages failed to built reproducibly:"
-			set_linktarget $META_BAD
 			link_packages $META_BAD
 			write_page "<br />"
 			if [ $COUNT_META_UGLY -gt 0 ] ; then
 				set_icon FTBFS
 				write_icon
 				write_page "$COUNT_META_UGLY ($PERCENT_META_UGLY%) packages failed to build from source:"
-				set_linktarget $META_UGLY
 				link_packages $META_UGLY
 				write_page "<br />"
 			fi
@@ -461,7 +458,6 @@ create_pkg_sets_page() {
 				set_icon 404
 				write_icon
 				write_page "$COUNT_META_REST ($PERCENT_META_REST%) packages are either blacklisted, not for us or cannot be downloaded:"
-				set_linktarget $META_REST
 				link_packages $META_REST
 				write_page "<br />"
 			fi

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