summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Endfinger2020-01-13 20:04:23 -0500
committerKenneth Endfinger2020-01-13 20:04:23 -0500
commit04daeb480a20144f754c41020fa37a449ac4121c (patch)
tree70d5e2333196cbca75f24d8a600e683b7ae03abb
parent5b8b5509d924124270ca35ce873901c738cce2cd (diff)
downloadaur-04daeb480a20144f754c41020fa37a449ac4121c.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..f740767fa16e
--- /dev/null
+++ b/check-for-update.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+set -e
+
+cd $(dirname "${0}")
+
+CRATE="cargo-asm"
+
+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://crates.io/api/v1/crates/${CRATE}" | jq -r '.crate.newest_version')
+if [ "${LATEST}" != "${CURRENT}" ]
+then
+ echo "${PKG} : AUR ${CURRENT} != Cargo ${LATEST}"
+ exit 1
+fi
+echo "${PKG} : AUR ${CURRENT} == Cargo ${LATEST}"
+exit 0