PKGBUILDs/extra/firefox/upload-symbol-archive

26 lines
567 B
Text
Raw Normal View History

2017-08-08 18:36:29 +00:00
#!/bin/bash -e
die() {
echo >&2 "$@"
exit 1
}
2017-08-11 13:50:38 +00:00
(( $# >= 2 )) || die "Usage: $0 TOKEN-FILE SYMBOL-ARCHIVE..."
token="$1"
shift
2017-08-08 18:36:29 +00:00
2017-08-11 13:50:38 +00:00
[[ -f $token && -s $token ]] || die "Invalid TOKEN-FILE ${token@Q}"
for zip; do
2020-01-20 15:50:28 +00:00
[[ $(file -SEbi "$zip") == application/zip* ]] || die "Invalid SYMBOL-ARCHIVE ${zip@Q}"
2017-08-11 13:50:38 +00:00
done
for zip; do
echo >&2 "Uploading ${zip@Q} ..."
curl -X POST -H "Auth-Token: $(<"$token")" -F "${zip##*/}=@$zip" \
2017-12-29 13:35:40 +00:00
--retry 4 --retry-connrefused --connect-timeout 120 \
2017-12-08 00:13:22 +00:00
https://symbols.mozilla.org/upload/
2017-08-11 13:50:38 +00:00
echo
2019-06-04 20:55:25 +00:00
mv -v "$zip" "$zip.uploaded"
2017-08-11 13:50:38 +00:00
done