summaryrefslogtreecommitdiffstats
path: root/bin/schroot-create.sh
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-09-09 10:56:32 +0200
committerHolger Levsen <holger@layer-acht.org>2015-09-09 10:56:32 +0200
commite4c788b026c60a1f58d6386b276a90d8d2aae325 (patch)
tree87235dd2f5a0c30dce8c4974f0d86c0b8230ba61 /bin/schroot-create.sh
parentab5d30e67a47e220f6a8311eb591e7cdfe6f2460 (diff)
downloadjenkins.debian.net-e4c788b026c60a1f58d6386b276a90d8d2aae325.tar.xz
fix logic to detect network failures
Diffstat (limited to 'bin/schroot-create.sh')
-rwxr-xr-xbin/schroot-create.sh4
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