Commit f625aeb9 authored by Holger Levsen's avatar Holger Levsen
Browse files

make more robust

parent 3fa8572b
...@@ -57,7 +57,7 @@ bootstrap() { ...@@ -57,7 +57,7 @@ bootstrap() {
echo "$(date -u ) - bootstraping $DISTRO into $CHROOT_TARGET now." echo "$(date -u ) - bootstraping $DISTRO into $CHROOT_TARGET now."
set +e set +e
sudo debootstrap $BOOTSTRAP_OPTIONS $DISTRO $CHROOT_TARGET $MIRROR | tee $TMPLOG sudo debootstrap $BOOTSTRAP_OPTIONS $DISTRO $CHROOT_TARGET $MIRROR | tee $TMPLOG
local RESULT=$(egrep "E: (Couldn't download packages|Invalid Release signature)" $TMPLOG) local RESULT=$(egrep "E: (Couldn't download packages|Invalid Release signature)" $TMPLOG || true )
rm $TMPLOG rm $TMPLOG
set -e set -e
if [ ! -z "$RESULT" ] ; then if [ ! -z "$RESULT" ] ; then
......
...@@ -113,7 +113,7 @@ EOF ...@@ -113,7 +113,7 @@ EOF
robust_chroot_apt() { robust_chroot_apt() {
set +e set +e
sudo chroot $SCHROOT_TARGET apt-get $@ | tee $TMPLOG sudo chroot $SCHROOT_TARGET apt-get $@ | tee $TMPLOG
local RESULT=$(egrep 'Failed to fetch.*(Unable to connect to|Connection failed|Size mismatch|Cannot initiate the connection to|Bad Gateway)' $TMPLOG) local RESULT=$(egrep 'Failed to fetch.*(Unable to connect to|Connection failed|Size mismatch|Cannot initiate the connection to|Bad Gateway)' $TMPLOG || true)
set -e set -e
if [ ! -z "$RESULT" ] ; then if [ ! -z "$RESULT" ] ; then
echo "$(date -u) - 'apt-get $@' failed, sleeping 5min before retrying..." echo "$(date -u) - 'apt-get $@' failed, sleeping 5min before retrying..."
...@@ -130,7 +130,7 @@ bootstrap() { ...@@ -130,7 +130,7 @@ bootstrap() {
echo "Bootstraping $SUITE into $SCHROOT_TARGET now." echo "Bootstraping $SUITE into $SCHROOT_TARGET now."
set +e set +e
sudo debootstrap $SUITE $SCHROOT_TARGET $MIRROR | tee $TMPLOG sudo debootstrap $SUITE $SCHROOT_TARGET $MIRROR | tee $TMPLOG
local RESULT=$(egrep "E: (Couldn't download packages|Invalid Release signature)" $TMPLOG) local RESULT=$(egrep "E: (Couldn't download packages|Invalid Release signature)" $TMPLOG || true)
set -e set -e
if [ ! -z "$RESULT" ] ; then if [ ! -z "$RESULT" ] ; then
echo "$(date -u) - initial debootstrap failed, sleeping 5min before retrying..." echo "$(date -u) - initial debootstrap failed, sleeping 5min before retrying..."
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment