summarylogtreecommitdiffstats
path: root/upgrade.sh
diff options
context:
space:
mode:
Diffstat (limited to 'upgrade.sh')
-rwxr-xr-xupgrade.sh25
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