summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Barri2021-02-25 09:53:38 +1100
committerDavid Barri2021-02-25 09:53:52 +1100
commit80d86cfd1faa7362fcab2ac0cfef0d092801fb5f (patch)
treeb46e81d8fdef6544e71377374dafa9a0830b6290
parentf6cb6ed06377db2230c83e512a991a9529624903 (diff)
downloadaur-80d86cfd1faa7362fcab2ac0cfef0d092801fb5f.tar.gz
Auto-upgrade
-rw-r--r--Makefile18
1 files changed, 17 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 4f09e42a93f..0c62cf7dbcb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,20 @@
-.PHONY: post clean
+.PHONY: post clean upgrade versions
+
+LATEST_VER := $(shell curl -s https://github.com/CryptoGraphics/VerthashMiner/releases/latest | perl -pe 's!.*/tag/(.+?)".*!$$1!')
+
+versions:
+ @echo "Current version:"
+ @grep '^pkgver' PKGBUILD | sed 's/.*=/ /'
+ @echo "Latest version:"
+ @echo " $(LATEST_VER)"
+
+upgrade:
+ perl -pi -e 's/^pkgver=.+/pkgver=$(LATEST_VER)/' PKGBUILD
+ bash -c 'perl -pi -e "s/^sha256sums=.+/$$(makepkg -g)/" PKGBUILD'
+ make post
+ git add .SRCINFO PKGBUILD
+ git commit -m "Upgrade to $(LATEST_VER)" .SRCINFO PKGBUILD
+ git show
post:
makepkg --verifysource -f