[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible: only download the .dsc on the main node when doing remote builds

Holger Levsen holger at moszumanska.debian.org
Thu Sep 10 10:00:13 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 84a31cbbf787aab56f4d0c2a497aa264f953c817
Author: Holger Levsen <holger at layer-acht.org>
Date:   Thu Sep 10 11:59:36 2015 +0200

    reproducible: only download the .dsc on the main node when doing remote builds
---
 TODO                      |  1 -
 bin/reproducible_build.sh | 20 ++++++++++++++++----
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/TODO b/TODO
index 97d5a6d..e93625a 100644
--- a/TODO
+++ b/TODO
@@ -173,7 +173,6 @@ properties:
 ** reproducible_build.sh changes needed:
 *** handle_unhandled() needs to unregister the build from the db too
 *** rbuild.log isnt show when a package ftbfs
-*** main host should not need to download sources
 *** diffoscope needs to be run on the target arch...
 **** should probably be doable with qemu-static on the host
 ** setup builder3, distribute more ressources
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index 518531e..fdbfbf4 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -402,8 +402,14 @@ init() {
 
 get_source_package() {
 	local RESULT
-	schroot --directory $TMPDIR -c source:jenkins-reproducible-$SUITE apt-get -- --download-only --only-source source ${SRCPACKAGE} 2>&1 | tee -a ${RBUILDLOG}
-	RESULT=$?
+	if [ "$MODE" != "ng" ] ; then
+		schroot --directory $TMPDIR -c source:jenkins-reproducible-$SUITE apt-get -- --download-only --only-source source ${SRCPACKAGE} 2>&1 | tee -a ${RBUILDLOG}
+		RESULT=$?
+	else
+		# remote build, no need to download the full source package...
+		schroot --directory $TMPDIR -c source:jenkins-reproducible-$SUITE apt-get -- --download-only --only-source --print-uris source ${SRCPACKAGE} | grep \.dsc|cut -d " " -f1|xargs wget
+		RESULT=$?
+	fi
 	if [ $RESULT != 0 ] || [ "$(ls ${SRCPACKAGE}_*.dsc 2> /dev/null)" = "" ] ; then
 		# sometimes apt-get cannot download a package for whatever reason.
 		# if so, wait some time and try again. only if that fails, give up.
@@ -411,8 +417,14 @@ get_source_package() {
 		ls -l ${SRCPACKAGE}* | tee -a ${RBUILDLOG}
 		echo "$(date -u ) - sleeping 5m before re-trying..." | tee -a ${RBUILDLOG}
 		sleep 5m
-		schroot --directory $TMPDIR -c source:jenkins-reproducible-$SUITE apt-get -- --download-only --only-source source ${SRCPACKAGE} 2>&1 | tee -a ${RBUILDLOG}
-		RESULT=$?
+		if [ "$MODE" != "ng" ] ; then
+			schroot --directory $TMPDIR -c source:jenkins-reproducible-$SUITE apt-get -- --download-only --only-source source ${SRCPACKAGE} 2>&1 | tee -a ${RBUILDLOG}
+			RESULT=$?
+		else
+			# remote build, no need to download the full source package...
+			schroot --directory $TMPDIR -c source:jenkins-reproducible-$SUITE apt-get -- --download-only --only-source --print-uris source ${SRCPACKAGE} | grep \.dsc|cut -d " " -f1|xargs wget
+			RESULT=$?
+		fi
 	fi
 	if [ $RESULT != 0 ] || [ "$(ls ${SRCPACKAGE}_*.dsc 2> /dev/null)" = "" ] ; then
 		if [ "$MODE" = "legacy" ] || [ "$MODE" = "ng" ] ; then

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