-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
curl: make certificates bundle generation more robust (#1778)
Don't use the default build system rule to create the certificates bundle: connections to `hg.mozilla.org` from CIs seem to be flaky, resulting in regular failures. Cf. https://curl.se/docs/caextract.html
- Loading branch information
1 parent
1c24dc1
commit 9a90ea8
Showing
2 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
output="$1" | ||
outdir="$(dirname "${output}")" | ||
|
||
mkdir -p "${outdir}" && curl \ | ||
--etag-compare "${output}.etag" \ | ||
--etag-save "${output}.etag" \ | ||
--output "${output}" \ | ||
--retry 3 \ | ||
https://curl.se/ca/cacert.pem | ||
code=$? | ||
|
||
if [ ${code} -ne 0 ]; then | ||
if [ -r "${output}" ]; then | ||
code=0 | ||
severity=WARNING | ||
else | ||
severity=ERROR | ||
fi | ||
printf '\033[31;1m%s:\033[0m failed to fetch “%s”\n' "${severity}" "${output}" 1>&2 | ||
fi | ||
|
||
exit ${code} | ||
|
||
# vim: sw=4 |