From 547f1d19e8dcb2b2a5b10fe03e21165fd0861f34 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Thu, 16 Oct 2014 11:00:34 +0200 Subject: reproducible: if apt-get source fails to download sources, wait 5m, try once more and only fail+warn+notify if the 2nd download attempt also fails --- bin/reproducible_build.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bin/reproducible_build.sh') diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index dc9c61ac..85f0f86a 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -52,6 +52,16 @@ else set +e apt-get source --download-only --only-source ${SRCPACKAGE} >> ${RBUILDLOG} 2>&1 RESULT=$? + if [ $RESULT != 0 ] ; then + # sometimes apt-get cannot download a package for whatever reason. + # if so, wait some time and try again. only if that fails, give up. + echo "Download of ${SRCPACKAGE} sources failed." | tee -a ${RBUILDLOG} + ls -l ${SRCPACKAGE}* | tee -a ${RBUILDLOG} + echo "Sleeping 5m before re-trying..." | tee -a ${RBUILDLOG} + sleep 5m + apt-get source --download-only --only-source ${SRCPACKAGE} >> ${RBUILDLOG} 2>&1 + RESULT=$? + fi if [ $RESULT != 0 ] ; then echo "Warning: Download of ${SRCPACKAGE} sources failed." | tee -a ${RBUILDLOG} ls -l ${SRCPACKAGE}* | tee -a ${RBUILDLOG} -- cgit v1.2.3-70-g09d2