aboutsummaryrefslogtreecommitdiffhomepage
path: root/dev/tools
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 /dev/tools
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.
Diffstat (limited to 'dev/tools')
-rwxr-xr-xdev/tools/sudo-apt-get-update.sh4
1 files changed, 4 insertions, 0 deletions
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 $?