diff options
author | Kenneth Endfinger | 2020-01-13 20:04:17 -0500 |
---|---|---|
committer | Kenneth Endfinger | 2020-01-13 20:04:17 -0500 |
commit | fe7887dbe4ce8259e5411e4b6b41557ea43e538a (patch) | |
tree | 1c83c9fefd495ad119d558e20fe4b715c145cc90 | |
parent | 80713bea1cce91b8b4a289aa5e2b81ea7235dbd4 (diff) | |
download | aur-fe7887dbe4ce8259e5411e4b6b41557ea43e538a.tar.gz |
Add check-for-update script.
-rwxr-xr-x | check-for-update.sh | 17 |
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..1f9977145006 --- /dev/null +++ b/check-for-update.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -e + +cd $(dirname "${0}") + +REPOSITORY="blackducksoftware/ohcount" + +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 -- "^v" | head -n1) +if [ "${LATEST}" != "${CURRENT}" ] +then + echo "${PKG} : AUR ${CURRENT} != GitHub ${LATEST}" + exit 1 +fi +echo "${PKG} : AUR ${CURRENT} == GitHub ${LATEST}" +exit 0 |