Retry on apt-get update problems

This commit is contained in:
Andrew Murray 2020-04-06 22:23:41 +10:00
parent e634c4dc0c
commit 7f5aa05f22

View File

@ -1,8 +1,22 @@
#!/bin/bash
aptget_update()
{
if [ ! -z $1 ]; then
echo ""
echo "Retrying apt-get update..."
echo ""
fi
output=`sudo apt-get update 2>&1`
echo "$output"
if [[ $output == *[WE]:\ * ]]; then
return 1
fi
}
aptget_update || aptget_update retry || aptget_update retry
set -e
sudo apt-get update
sudo apt-get -qq install libfreetype6-dev liblcms2-dev python3-tk\
ghostscript libffi-dev libjpeg-turbo-progs libopenjp2-7-dev\
cmake imagemagick libharfbuzz-dev libfribidi-dev