2019-06-23 12:10:52 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
set -x
|
|
|
|
|
2024-10-21 21:36:34 +02:00
|
|
|
cd "$1"
|
|
|
|
|
2019-06-23 12:10:52 +02:00
|
|
|
MACH=$(uname -m)
|
|
|
|
MACH="${MACH/aarch64/aarch_64}"
|
|
|
|
|
2024-09-08 14:58:26 +02:00
|
|
|
VERSION=28.0
|
2019-06-23 12:10:52 +02:00
|
|
|
FILENAME=protoc-"$VERSION"-linux-"$MACH".zip
|
|
|
|
|
|
|
|
if [ -e "$FILENAME" ]; then
|
|
|
|
echo "$FILENAME" already exists 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-10-21 21:36:34 +02:00
|
|
|
wget --continue https://github.com/protocolbuffers/protobuf/releases/download/v"$VERSION"/"$FILENAME"
|
2019-06-23 12:10:52 +02:00
|
|
|
|
|
|
|
stat "$FILENAME"
|
|
|
|
|
|
|
|
sha256sum -c --ignore-missing <<EOF
|
2024-09-08 14:58:26 +02:00
|
|
|
d622619dcbfb5ecb281cfb92c1a74d6a0f42e752d9a2774b197f475f7ab1c8c4 protoc-28.0-linux-aarch_64.zip
|
|
|
|
b2e187c8b9f2d97cd3ecae4926d1bb2cbebe3ab768e7c987cbc86bb17f319358 protoc-28.0-linux-x86_64.zip
|
2019-06-23 12:10:52 +02:00
|
|
|
EOF
|
|
|
|
|
2024-10-21 21:36:34 +02:00
|
|
|
unzip -d . "$FILENAME"
|