There was an error while loading. Please reload this page.
2 parents cb25aac + 6b15b59 commit 792bfa2Copy full SHA for 792bfa2
1 file changed
ci/linux-install-protobuf.sh
@@ -23,7 +23,24 @@ install_protobuf() {
23
fi
24
25
zipfile="protoc-${version}-${arch}.zip"
26
- wget --quiet "$baseurl/$zipfile"
+
27
+ # Retry in case of transient errors.
28
+ tries=3
29
+ while [ $tries -gt 0 ]; do
30
+ # -O keeps every attempt writing to the same file rather than adding a .1 suffix.
31
+ status=0
32
+ wget --quiet -O "$zipfile" "$baseurl/$zipfile" || status=$?
33
+ if [ $status -eq 0 ]; then
34
+ break
35
+ fi
36
+ tries=$((tries - 1))
37
+ sleep 10
38
+ done
39
+ if [ $tries -eq 0 ]; then
40
+ echo "wget failed with status $status: $baseurl/$zipfile" >&2
41
+ exit 1
42
43
44
echo "$sha $zipfile" | sha256sum --check -
45
# Installs bin/protoc and include/ under /usr/local.
46
unzip -o "$zipfile" -d /usr/local
0 commit comments