summarylogtreecommitdiffstats
path: root/update_version.sh
diff options
context:
space:
mode:
authorDan Fuhry2023-04-03 14:42:59 -0400
committerDan Fuhry2023-04-03 14:42:59 -0400
commit86c82c665a5eb235f0c53bdc95f3d544ad4faf04 (patch)
tree9800c83805f63da5a0438b66fdee6c0fc5ad220a /update_version.sh
parentd9482dc0fb13f91d1fff63aab60fe87491004c65 (diff)
downloadaur-86c82c665a5eb235f0c53bdc95f3d544ad4faf04.tar.gz
updpkg: teleport 12.1.5-1
Diffstat (limited to 'update_version.sh')
-rwxr-xr-xupdate_version.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/update_version.sh b/update_version.sh
index ef8cdfa4bcc9..caf32f752321 100755
--- a/update_version.sh
+++ b/update_version.sh
@@ -2,6 +2,7 @@
# vim: set ft=sh ts=4 sw=4 et:
major_version=12
+vers=
set -e
. /usr/share/makepkg/util/util.sh
@@ -10,13 +11,18 @@ warning "This script calls out to github's API to determine the latest"
warning "version and build number. Press Ctrl+C within 2 seconds to abort."
sleep 2
-msg "Getting latest Teleport release"
-gh_url="https://api.github.com/repos/gravitational/teleport/git/matching-refs/tags/v${major_version}."
-vers=$(curl -SsLl "${gh_url}" | jq -r 'reverse | .[0].ref' | sed -re 's;^refs/tags/v;;')
-if ! [[ "$vers" =~ ^[0-9]+(\.[0-9]+)+$ ]]; then
- echo "Version string "\""${vers}"\"" doesn't look like a valid version number" >&2
- exit 1
+if [ -n "$1" ]; then
+ vers="$1"; shift
+else
+ msg "Getting latest Teleport release"
+ gh_url="https://api.github.com/repos/gravitational/teleport/git/matching-refs/tags/v${major_version}."
+ vers=$(curl -SsLl "${gh_url}" | jq -r 'reverse | .[0].ref' | sed -re 's;^refs/tags/v;;')
+ if ! [[ "$vers" =~ ^[0-9]+(\.[0-9]+)+$ ]]; then
+ echo "Version string "\""${vers}"\"" doesn't look like a valid version number" >&2
+ exit 1
+ fi
fi
+
msg "Using teleport version: ${vers}"
sed -re "s;^pkgver=.+$;pkgver=${vers};" -i PKGBUILD