From 95c496cddccd7b3c25e06b54a50c4a2c58df66d4 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Tue, 2 Apr 2024 15:52:31 +0200 Subject: [PATCH] Include go tool versions in version check Signed-off-by: Knut Ahlers --- update_version.sh | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/update_version.sh b/update_version.sh index 37a3083..56fd840 100644 --- a/update_version.sh +++ b/update_version.sh @@ -1,13 +1,37 @@ #!/bin/bash set -euo pipefail -curl -sSf https://archlinux.org/packages/extra/x86_64/go/json/ | - jq -r '"# " + .pkgname + " v" + .pkgver + "-" + .pkgrel' >tools.txt.new +pkgs=($( + curl -sSfL "https://raw.githubusercontent.com/fatih/vim-go/master/plugin/go.vim" | + grep -Eo "\\ \['[^']*/[^']*'" | + tr -d "[' " | + sort +)) -curl -sSfL "https://raw.githubusercontent.com/fatih/vim-go/master/plugin/go.vim" | - grep -Eo "\\ \['[^']*/[^']*'" | - tr -d "[' " | - sort >>tools.txt.new +versions=() + +echo "### Packages from vim-go" >tools.txt.new + +for pkg in "${pkgs[@]}"; do + qpkg=${pkg%@*} + ver="" + while [[ -z $ver ]]; do + ver=$(curl -sSf "https://proxy.golang.org/${qpkg}/@latest" | jq -r .Version || echo -n "") + [[ -n $ver ]] || qpkg=${qpkg%/*} + done + + versions+=("# GoProxy: ${qpkg} ${ver}") + echo "${pkg}" >>tools.txt.new +done + +echo -e "\n### Version checking for package rebuilds" >>tools.txt.new + +curl -sSf https://archlinux.org/packages/extra/x86_64/go/json/ | + jq -r '"# Archlinux: " + .pkgname + " v" + .pkgver + "-" + .pkgrel' >>tools.txt.new + +for ver in "${versions[@]}"; do + echo "${ver}" >>tools.txt.new +done diff tools.txt tools.txt.new && { echo "Up to date"