diff options
author | dreamscached | 2021-10-10 12:55:34 +0200 |
---|---|---|
committer | dreamscached | 2021-10-10 12:55:34 +0200 |
commit | 895769f119852458fb4fac61ae2841f16914caa3 (patch) | |
tree | 448c9c3ec8decd8c1afdcd9e806223a5eb5a11e5 | |
parent | d74b97844e3ef485fa937ce0de472b780dd747b8 (diff) | |
download | aur-895769f119852458fb4fac61ae2841f16914caa3.tar.gz |
Add upgrade script
-rwxr-xr-x | upgrade.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/upgrade.sh b/upgrade.sh new file mode 100755 index 000000000000..80dbf1f3ad84 --- /dev/null +++ b/upgrade.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -e + +if [ "$#" -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then + echo "Usage: $0 [-h|--help] version" >&2 + exit 1 +fi + +. ./PKGBUILD +sed -i "s/$pkgver/$1/" PKGBUILD +. ./PKGBUILD + +tmp="$(mktemp)" +cleanup() { rm -f "$tmp"; } +trap cleanup EXIT + +curl -sL "${source[0]}" -o "$tmp" +sum="$(sha256sum "$tmp" | cut -c -64)" + +cleanup +unset cleanup +trap - EXIT + +sed -i -e "s/${sha256sums[0]}/$sum/g" PKGBUILD +makepkg --printsrcinfo > .SRCINFO |