[apt-retry] - Added logic to retry apt update
When there is failure to fetch any of the apt urls, it skips and continues. Due to which apt install fails in next step. So added retry if apt fetch fails before proceeding to apt install. Change-Id: I658024481b1be98d280cb1c9c4c2fb733a0d5697
This commit is contained in:
parent
fe29812aca
commit
ff0a7ccabb
|
@ -82,15 +82,16 @@ set -x
|
|||
|
||||
end=$(($(date +%s) + APT_INSTALL_TIMEOUT))
|
||||
while true; do
|
||||
if ! apt-get update; then
|
||||
if ! apt-get update 2>&1 | grep -q '^W: Failed to fetch'; then
|
||||
break
|
||||
else
|
||||
now=$(date +%s)
|
||||
if [[ ${now} -gt ${end} ]]; then
|
||||
log Failed to update apt-cache.
|
||||
log "Failed to update apt-cache."
|
||||
exit 1
|
||||
fi
|
||||
log "re-try apt-get update..."
|
||||
sleep 10
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in New Issue