Include go tool versions in version check

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2024-04-02 15:52:31 +02:00
parent 2da45b5d37
commit 95c496cddc
Signed by: luzifer
SSH key fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E

View file

@ -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"