[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] schroot-create: needs to check PIPESTATUS right after the relevant line

Mattia Rizzolo gitlab at salsa.debian.org
Wed Jun 26 19:15:57 BST 2019



Mattia Rizzolo pushed to branch master at Debian QA / jenkins.debian.net


Commits:
fc3fdd79 by Mattia Rizzolo at 2019-06-26T18:15:45Z
schroot-create: needs to check PIPESTATUS right after the relevant line

Signed-off-by: Mattia Rizzolo <mattia at debian.org>

- - - - -


1 changed file:

- bin/schroot-create.sh


Changes:

=====================================
bin/schroot-create.sh
=====================================
@@ -76,8 +76,9 @@ fi
 
 robust_chroot_apt() {
 	sudo chroot $SCHROOT_TARGET apt-get $@ | tee $TMPLOG
+	local rt="${PIPESTATUS[0]}"
 	local RESULT=$(egrep 'Failed to fetch.*(Unable to connect to|Connection failed|Size mismatch|Cannot initiate the connection to|Bad Gateway|Service Unavailable)' $TMPLOG || true)
-	if [ ! -z "$RESULT" ] || [ "${PIPESTATUS[0]}" -ne 0 ] ; then
+	if [ ! -z "$RESULT" ] || [ "$rt" -ne 0 ] ; then
 		echo "$(date -u) - 'apt-get $@' failed, sleeping 5min before retrying..."
 		sleep 5m
 		sudo chroot $SCHROOT_TARGET apt-get $@ || ( echo "$(date -u ) - 2nd 'apt-get $@' failed, giving up..." ; exit 1 )
@@ -91,8 +92,9 @@ bootstrap() {
 
 	echo "Bootstraping $SUITE into $SCHROOT_TARGET now."
 	sudo debootstrap $SUITE $SCHROOT_TARGET $MIRROR | tee $TMPLOG
+	local rt="${PIPESTATUS[0]}"
 	local RESULT=$(egrep "E: (Couldn't download packages|Invalid Release signature)" $TMPLOG || true)
-	if [ ! -z "$RESULT" ] || [ "${PIPESTATUS[0]}" -ne 0 ] ; then
+	if [ ! -z "$RESULT" ] || [ "$rt" -ne 0 ]; then
 		echo "$(date -u) - initial debootstrap failed, sleeping 5min before retrying..."
 		sudo rm -rf --one-file-system $SCHROOT_TARGET
 		sleep 5m



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/fc3fdd79379427a18955432a1dc9efddc05972b9

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/fc3fdd79379427a18955432a1dc9efddc05972b9
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/20190626/1478c19a/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list