summarylogtreecommitdiffstats
path: root/update.sh
diff options
context:
space:
mode:
authorMatt Scheirer2020-04-16 09:38:10 -0400
committerMatt Scheirer2020-04-16 09:38:10 -0400
commite51586c45784c27c279d63c4fb5fa5a6524c95b1 (patch)
tree9fe5528fe85c113a5a79ab65e3bbdb8f4cfb4bdb /update.sh
parent0d2fa945672ba204ba7b35f56d1d36b304c371b1 (diff)
downloadaur-e51586c45784c27c279d63c4fb5fa5a6524c95b1.tar.gz
Add autoupdater script
Diffstat (limited to 'update.sh')
-rw-r--r--update.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/update.sh b/update.sh
new file mode 100644
index 000000000000..c3846c35fb35
--- /dev/null
+++ b/update.sh
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+set -e
+
+name="ODAFileConverter_QT5_lnxX64_4.7dll.deb"
+
+wget -N "https://download.opendesign.com/guestfiles/ODAFileConverter/$name" -P /tmp
+new=( $(sha256sum "/tmp/$name") )
+old=$(grep -oP "sha256sums=\('\K[[:alnum:]]{64}(?=')" PKGBUILD)
+
+if [ "$new" = "$old" ]; then
+ echo "No updates!"
+ exit 0
+fi
+
+ver=$(ar p "/tmp/$name" control.tar.gz | tar xzO ./control | grep -oP "Version: \K.+$")
+sed -i "/^pkgver=/s/.+/$ver" PKGBUILD
+makepkg -f
+makepkg --printsrcinfo > .SRCINFO
+git commit -a -m "$ver"
+git push