summarylogtreecommitdiffstats
path: root/update.sh
diff options
context:
space:
mode:
authorAlexandre Bury2022-06-29 12:09:44 -0400
committerAlexandre Bury2022-06-29 12:09:44 -0400
commit478ca5e3de974d1fe45b277dfaf718f770dce809 (patch)
treec76840867ae0d7da9a24a4206d2f696b0a1a2fdc /update.sh
parent61901431ff664da705ccccb37abc25e2e91fa6bb (diff)
downloadaur-478ca5e3de974d1fe45b277dfaf718f770dce809.tar.gz
Fix hashsums
Diffstat (limited to 'update.sh')
-rwxr-xr-xupdate.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/update.sh b/update.sh
index 7fdd64bc5460..04fd2d9a22eb 100755
--- a/update.sh
+++ b/update.sh
@@ -1,4 +1,9 @@
#!/bin/bash
+set -e
+set -o pipefail
+
+HASH=b2sum
+HASH_NAME=b2sums
source PKGBUILD
PKGNAME=$_name
@@ -20,9 +25,9 @@ DOWNLOAD_URL=$(jq -r <<<$RELEASES --arg last $LAST '
.[$last][] | select(.packagetype == "sdist").url
')
-HSUM=$(curl -sL $DOWNLOAD_URL | b2sum - | cut -d' ' -f1)
+SUM=$(curl -sL $DOWNLOAD_URL | $HASH - | cut -d' ' -f1)
-sed -i 's/b2sums=.*$/b2sums=("'$HSUM'")/' PKGBUILD
+sed -i 's/.*sums=.*$/'$HASH_NAME'=("'$SUM'")/' PKGBUILD
sed -i 's/pkgver=.*/pkgver='$LAST'/' PKGBUILD
sed -i 's/pkgrel=.*/pkgrel=1/' PKGBUILD