diff options
author | Fathi Boudra <fathi.boudra@linaro.org> | 2016-11-08 10:27:25 +0200 |
---|---|---|
committer | Fathi Boudra <fathi.boudra@linaro.org> | 2016-11-08 10:27:25 +0200 |
commit | 6e8ebec2d88e6241d4c2532bba9294ede50f7802 (patch) | |
tree | 3fb3da479d399674c07b358b8230be97df790d6c /rpb-openembedded | |
parent | 3b6b465e306023209481fc88755d94434993c541 (diff) |
rpb-openembedded: retry apt on transistent errors
Sometime apt-get commands fail on http errors or has mismatch
errors. Try our luck and retry the commands before failing,
because we are not really interested in infra errors.
Change-Id: I4d6d58879d4ecb0e7ec31d3b2d713f3a089ac900
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to 'rpb-openembedded')
-rwxr-xr-x | rpb-openembedded/builders.sh | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/rpb-openembedded/builders.sh b/rpb-openembedded/builders.sh index 17e1ea38cb..f3500b5457 100755 --- a/rpb-openembedded/builders.sh +++ b/rpb-openembedded/builders.sh @@ -1,13 +1,13 @@ #!/bin/bash +set -e + # workaround EDK2 is confused by the long path used during the build # and truncate files name expected by VfrCompile sudo mkdir -p /srv/oe sudo chown buildslave:buildslave /srv/oe cd /srv/oe -set -ex - trap cleanup_exit INT TERM EXIT cleanup_exit() @@ -15,8 +15,19 @@ cleanup_exit() echo "Running cleanup_exit..." } -sudo apt-get update -sudo apt-get install -y python-pycurl chrpath gawk texinfo libsdl1.2-dev whiptail diffstat cpio libssl-dev android-tools-fsutils +if ! sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 update; then + echo "INFO: apt update error - try again in a moment" + sleep 15 + sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 update || true +fi +pkg_list="python-pycurl chrpath gawk texinfo libsdl1.2-dev whiptail diffstat cpio libssl-dev android-tools-fsutils" +if ! sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 install -y "${pkg_list}"; then + echo "INFO: apt install error - try again in a moment" + sleep 15 + sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 install -y "${pkg_list}" +fi + +set -ex mkdir -p ${HOME}/bin curl https://storage.googleapis.com/git-repo-downloads/repo > ${HOME}/bin/repo |