[Qa-jenkins-scm] [jenkins.debian.net] 02/02: reproducible: correctly deal with $TMPDIR

Holger Levsen holger at moszumanska.debian.org
Sun Aug 30 21:26: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 0778af66e6351aa31c46ee725b07a4d826519879
Author: Holger Levsen <holger at layer-acht.org>
Date:   Sun Aug 30 23:26:17 2015 +0200

    reproducible: correctly deal with $TMPDIR
---
 bin/reproducible_build.sh | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index 9d808ad..22bf74d 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -391,7 +391,7 @@ init() {
 
 get_source_package() {
 	local RESULT
-	schroot --directory $PWD -c source:jenkins-reproducible-$SUITE apt-get -- --download-only --only-source source ${SRCPACKAGE} 2>&1 | tee -a ${RBUILDLOG}
+	schroot --directory $TMPDIR -c source:jenkins-reproducible-$SUITE apt-get -- --download-only --only-source source ${SRCPACKAGE} 2>&1 | tee -a ${RBUILDLOG}
 	RESULT=$?
 	if [ $RESULT != 0 ] || [ "$(ls ${SRCPACKAGE}_*.dsc 2> /dev/null)" = "" ] ; then
 		# sometimes apt-get cannot download a package for whatever reason.
@@ -400,7 +400,7 @@ get_source_package() {
 		ls -l ${SRCPACKAGE}* | tee -a ${RBUILDLOG}
 		echo "Sleeping 5m before re-trying..." | tee -a ${RBUILDLOG}
 		sleep 5m
-		schroot --directory $PWD -c source:jenkins-reproducible-$SUITE apt-get -- --download-only --only-source source ${SRCPACKAGE} 2>&1 | tee -a ${RBUILDLOG}
+		schroot --directory $TMPDIR -c source:jenkins-reproducible-$SUITE apt-get -- --download-only --only-source source ${SRCPACKAGE} 2>&1 | tee -a ${RBUILDLOG}
 		RESULT=$?
 	fi
 	if [ $RESULT != 0 ] || [ "$(ls ${SRCPACKAGE}_*.dsc 2> /dev/null)" = "" ] ; then
@@ -504,7 +504,13 @@ check_buildinfo() {
 		echo "Building ${SRCPACKAGE}/${VERSION} in ${SUITE} on ${ARCH} now."
 		echo "============================================================================="
 		echo
-		first_build
+		if [ "$MODE" = "legacy" ] ; then
+			first_build
+		else
+			ssh -p $PORT1 $NODE1 /srv/jenkins/bin/reproducible_build.sh 1 ${SRCPACKAGE} ${SUITE} ${TMPDIR}
+			rsync -e "ssh -p $PORT1" -r $NODE1:$TMPDIR/b1 .
+			ssh -p $PORT1 $NODE1 "rm -r $TMPDIR/b1"
+		fi
 		grep-dctrl -s Build-Environment -n ${SRCPACKAGE} ./b1/$BUILDINFO > $TMPFILE1
 		set +e
 		diff $TMPFILE1 $TMPFILE2
@@ -524,8 +530,8 @@ build_rebuild() {
 		first_build
 	else
 		ssh -p $PORT1 $NODE1 /srv/jenkins/bin/reproducible_build.sh 1 ${SRCPACKAGE} ${SUITE} ${TMPDIR}
-		rsync -e "ssh -p $PORT1" -r $NODE1:$PWD/b1 .
-		ssh -p $PORT1 $NODE1 "rm -r $PWD/b1"
+		rsync -e "ssh -p $PORT1" -r $NODE1:$TMPDIR/b1 .
+		ssh -p $PORT1 $NODE1 "rm -r $TMPDIR/b1"
 	fi
 	if [ -f b1/${SRCPACKAGE}_${EVERSION}_${ARCH}.changes ] ; then
 		# the first build did not FTBFS, try rebuild it.
@@ -537,8 +543,8 @@ build_rebuild() {
 			second_build
 		else
 			ssh -p $PORT2 $NODE2 /srv/jenkins/bin/reproducible_build.sh 2 ${SRCPACKAGE} ${SUITE} ${TMPDIR}
-			rsync -e "ssh -p $PORT2" -r $NODE2:$PWD/b2 .
-			ssh -p $PORT2 $NODE2 "rm -r $PWD/b2"
+			rsync -e "ssh -p $PORT2" -r $NODE2:$TMPDIR/b2 .
+			ssh -p $PORT2 $NODE2 "rm -r $TMPDIR/b2"
 		fi
 		if [ -f b2/${SRCPACKAGE}_${EVERSION}_${ARCH}.changes ] ; then
 			# both builds were fine, i.e., they did not FTBFS.
@@ -584,6 +590,7 @@ elif [ "$1" = "1" ] || [ "$1" = "2" ] ; then
 	else
 		second_build
 	fi
+	echo "$(date -u) - build #$MODE for $SRCPACKAGE/$SUITE/$ARCH on $HOSTNAME done"
 	exit 0
 elif [ "$2" != "" ] ; then
 	MODE="ng"

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