summarylogtreecommitdiffstats
path: root/update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'update.sh')
-rwxr-xr-xupdate.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/update.sh b/update.sh
new file mode 100755
index 000000000000..ea05959fc2ff
--- /dev/null
+++ b/update.sh
@@ -0,0 +1,22 @@
+#!/bin/bash -x
+
+git pull
+
+pkgver="${1}"
+if [[ -z "${pkgver}" ]]; then
+ pkgver=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/apple/foundationdb/releases/latest | cut -d '/' -f 8)
+fi
+
+URL="https://github.com/apple/foundationdb/releases/download/${pkgver}/foundationdb-server_${pkgver}-1_amd64.deb"
+chksum=$(curl -Ls "${URL}.sha256" | awk '{print $1}')
+
+if [[ $(echo -n "${chksum}" | wc -c) -ne 64 ]]; then
+ echo "Cannot download release"
+ exit -2
+fi
+
+sed -i "s/pkgver=.*/pkgver=${pkgver}/g" PKGBUILD
+sed -i "s/sha256sums_x86_64=.*/sha256sums_x86_64=('${chksum}')/g" PKGBUILD
+
+makepkg -f || exit -10
+makepkg --printsrcinfo > .SRCINFO || exit -11