summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Endfinger2020-01-13 20:04:47 -0500
committerKenneth Endfinger2020-01-13 20:04:47 -0500
commit86d864c286ca7b0ee7bb2f426e6c83c8c8dee8e4 (patch)
tree596dc4624cec217cd84e12992632cf655343bbea
parent4b8054f4d229013aec82056aa85c0e1a008c08d3 (diff)
downloadaur-86d864c286ca7b0ee7bb2f426e6c83c8c8dee8e4.tar.gz
Add check-for-update script.
-rwxr-xr-xcheck-for-update.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/check-for-update.sh b/check-for-update.sh
new file mode 100755
index 000000000000..fdf81a284013
--- /dev/null
+++ b/check-for-update.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+set -e
+
+cd $(dirname "${0}")
+
+REPOSITORY="dtolnay/cargo-tally"
+
+PKG=$(cat .SRCINFO | grep "pkgbase" | head -n1 | awk '{print $3}')
+CURRENT=$(cat .SRCINFO | grep "pkgver" | head -n1 | awk '{print $3}')
+LATEST=$(curl --silent -L "https://api.github.com/repos/${REPOSITORY}/tags" | jq -r '.[].name' | grep -v -- "-" | head -n1)
+if [ "${LATEST}" != "${CURRENT}" ]
+then
+ echo "${PKG} : AUR ${CURRENT} != GitHub ${LATEST}"
+ exit 1
+fi
+echo "${PKG} : AUR ${CURRENT} == GitHub ${LATEST}"
+exit 0