From af624f5c8e11817a27302eaaccedb410dbdd71c9 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Fri, 28 Apr 2017 13:54:59 +0200 Subject: reproducible/openwrt|lede: retry downloads 5 times Signed-off-by: Holger Levsen --- bin/reproducible_lede_common.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/reproducible_lede_common.sh b/bin/reproducible_lede_common.sh index 38cc2a53..ddfddc69 100644 --- a/bin/reproducible_lede_common.sh +++ b/bin/reproducible_lede_common.sh @@ -237,6 +237,7 @@ openwrt_download() { local TARGET=$1 local CONFIG=$2 local TMPDIR=$3 + local tries=5 cd $TMPDIR/download @@ -253,7 +254,15 @@ openwrt_download() { # configure openwrt because otherwise it wont download everything openwrt_config $CONFIG - make download -j $NUM_CPU IGNORE_ERRORS=ym BUILD_LOG=1 + while ! make download -j $NUM_CPU IGNORE_ERRORS=ym BUILD_LOG=1 ; do + tries=$((tries - 1)) + if [ $tries -eq 0 ] ; then + echo "================================================================================" + echo "$(date -u) - Failed to download sources" + echo "================================================================================" + exit 1 + fi + done } openwrt_get_banner() { -- cgit v1.2.3-70-g09d2