summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_build.sh
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2014-10-16 11:00:34 +0200
committerHolger Levsen <holger@layer-acht.org>2014-10-16 11:00:34 +0200
commit547f1d19e8dcb2b2a5b10fe03e21165fd0861f34 (patch)
tree34eec5ab303ec56102ba07d442a6d19cfa98925a /bin/reproducible_build.sh
parent9fb9feef3908b639c4dcf22809b1661f9b054f28 (diff)
downloadjenkins.debian.net-547f1d19e8dcb2b2a5b10fe03e21165fd0861f34.tar.xz
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
Diffstat (limited to 'bin/reproducible_build.sh')
-rwxr-xr-xbin/reproducible_build.sh10
1 files changed, 10 insertions, 0 deletions
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
@@ -53,6 +53,16 @@ else
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}
sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO source_packages VALUES (\"${SRCPACKAGE}\", \"None\", \"404\", \"$DATE\")"