aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2018-01-23 14:27:56 -0500
committerGravatar Jason Gross <jgross@mit.edu>2018-01-23 14:27:56 -0500
commit27afc7b3848eaf6d1e4c5c35c3a67f4c9cee1a7c (patch)
treec31fee0f8bcbe3fa48c936d090b8fa51fe1ffb1d
parent2e798fb83db743ce44350af6f7f9442811f374ad (diff)
Use travis_retry on apt-get update
Script modified from https://unix.stackexchange.com/questions/175146/apt-get-update-exit-status I stuck the code in "install" rather than "before_install" so that the lint target didn't need to be changed. I also haven't touched the targets that add more packages; I'll leave that to someone who knows more about the "&" and "*" syntax being used in the configuration.
-rw-r--r--.travis.yml2
-rwxr-xr-xdev/tools/sudo-apt-get-update.sh4
2 files changed, 6 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
index 8f1f1e699..b51bf2a27 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -212,6 +212,8 @@ before_install:
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then echo "Tested commit (followed by parent commits):"; git log -1; for commit in `git log -1 --format="%P"`; do echo; git log -1 $commit; done; fi
install:
+- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then travis_retry ./dev/tools/sudo-apt-get-update.sh -q; fi
+- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then sudo apt-get install -y opam aspcud gcc-multilib; fi
- opam init -j ${NJOBS} --compiler=${COMPILER} -n -y
- eval $(opam config env)
- opam config list
diff --git a/dev/tools/sudo-apt-get-update.sh b/dev/tools/sudo-apt-get-update.sh
new file mode 100755
index 000000000..f8bf6bed4
--- /dev/null
+++ b/dev/tools/sudo-apt-get-update.sh
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+
+(sudo apt-get update "$@" 2>&1 || echo 'E: update failed') | tee /tmp/apt.err
+! grep -q '^\(E:\|W: Failed to fetch\)' /tmp/apt.err || exit $?