diff options
author | Kenneth Endfinger | 2020-01-13 20:04:59 -0500 |
---|---|---|
committer | Kenneth Endfinger | 2020-01-13 20:04:59 -0500 |
commit | bebf283f23b0a884684830bfb883071fba4f3482 (patch) | |
tree | 3eae4b6bb6685ab551a5864116a6ee88688daf99 | |
parent | 6e3b1bcdd44c3e950ffeafa82526d4d101913a96 (diff) | |
download | aur-bebf283f23b0a884684830bfb883071fba4f3482.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..caaefa5cee09 --- /dev/null +++ b/check-for-update.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -e + +cd $(dirname "${0}") + +REPOSITORY="xyproto/algernon" + +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 -- "-" | grep -v "^v" | grep "\." | head -n1) +if [ "${LATEST}" != "${CURRENT}" ] +then + echo "${PKG} : AUR ${CURRENT} != GitHub ${LATEST}" + exit 1 +fi +echo "${PKG} : AUR ${CURRENT} == GitHub ${LATEST}" +exit 0 |