From 2ccb4f0a631291f0ae3df1438b60c95d5d51374a Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 26 Jan 2015 11:05:36 +0100 Subject: chroot-install: work around temporarily download problems by repeating the step once --- bin/chroot-installation.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/chroot-installation.sh b/bin/chroot-installation.sh index 4fa90188..48215117 100755 --- a/bin/chroot-installation.sh +++ b/bin/chroot-installation.sh @@ -26,8 +26,10 @@ sleep $SLEEP export CHROOT_TARGET=$(mktemp -d -p /chroots/ chroot-installation-$1.XXXXXXXXX) export TMPFILE=$(mktemp -u) export CTMPFILE=$CHROOT_TARGET/$TMPFILE +export TMPLOG=$(mktemp) cleanup_all() { + echo "Doing cleanup now." # test if $CHROOT_TARGET starts with /chroots/ if [ "${CHROOT_TARGET:0:9}" != "/chroots/" ] ; then echo "HALP. CHROOT_TARGET = $CHROOT_TARGET" @@ -35,11 +37,19 @@ cleanup_all() { fi sudo umount -l $CHROOT_TARGET/proc || fuser -mv $CHROOT_TARGET/proc sudo rm -rf --one-file-system $CHROOT_TARGET || fuser -mv $CHROOT_TARGET + rm -f $TMPLOG } execute_ctmpfile() { chmod +x $CTMPFILE - sudo chroot $CHROOT_TARGET $TMPFILE + sudo chroot $CHROOT_TARGET $TMPFILE 2>&1 | tee $TMPLOG + RESULT=$(egrep "Failed to fetch.*Unable to connect to" $TMPLOG) + if [ ! -z "$RESULT" ] ; then + echo + echo "Trying to workaround temporarily failure fetching packages, trying again..." + echo + sudo chroot $CHROOT_TARGET $TMPFILE + fi rm $CTMPFILE } -- cgit v1.2.3-70-g09d2