diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-09-09 10:56:32 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-09-09 10:56:32 +0200 |
commit | e4c788b026c60a1f58d6386b276a90d8d2aae325 (patch) | |
tree | 87235dd2f5a0c30dce8c4974f0d86c0b8230ba61 | |
parent | ab5d30e67a47e220f6a8311eb591e7cdfe6f2460 (diff) | |
download | jenkins.debian.net-e4c788b026c60a1f58d6386b276a90d8d2aae325.tar.xz |
fix logic to detect network failures
-rwxr-xr-x | bin/schroot-create.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/schroot-create.sh b/bin/schroot-create.sh index 427dc2a8..e67cd28b 100755 --- a/bin/schroot-create.sh +++ b/bin/schroot-create.sh @@ -102,7 +102,7 @@ robust_chroot_apt() { sudo chroot $CHROOT_TARGET apt-get $@ | tee $TMPLOG RESULT=$(egrep 'Failed to fetch.*(Unable to connect to|Connection failed|Size mismatch|Cannot initiate the connection to|Bad Gateway)' $TMPLOG) set -e - if [ -z "$RESULT" ] ; then + if [ ! -z "$RESULT" ] ; then echo "$(date -u) - 'apt-get $@' failed, sleeping 5min before retrying..." sleep 5m sudo chroot $CHROOT_TARGET apt-get $@ @@ -119,7 +119,7 @@ bootstrap() { sudo debootstrap $SUITE $CHROOT_TARGET $MIRROR | tee $TMPLOG RESULT=$(egrep "E: Couldn't download packages" $TMPLOG) set -e - if [ -z "$RESULT" ] ; then + if [ ! -z "$RESULT" ] ; then echo "$(date -u) - initial debootstrap failed, sleeping 5min before retrying..." sudo rm -rf --one-file-system $CHROOT_TARGET sleep 5m |