2019-06-12 12:38:37 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
2024-04-02 13:52:31 +00:00
|
|
|
pkgs=($(
|
|
|
|
curl -sSfL "https://raw.githubusercontent.com/fatih/vim-go/master/plugin/go.vim" |
|
|
|
|
grep -Eo "\\ \['[^']*/[^']*'" |
|
|
|
|
tr -d "[' " |
|
|
|
|
sort
|
|
|
|
))
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2023-05-20 12:10:40 +00:00
|
|
|
curl -sSf https://archlinux.org/packages/extra/x86_64/go/json/ |
|
2024-04-02 13:52:31 +00:00
|
|
|
jq -r '"# Archlinux: " + .pkgname + " v" + .pkgver + "-" + .pkgrel' >>tools.txt.new
|
2023-05-07 14:38:08 +00:00
|
|
|
|
2024-04-02 13:52:31 +00:00
|
|
|
for ver in "${versions[@]}"; do
|
|
|
|
echo "${ver}" >>tools.txt.new
|
|
|
|
done
|
2019-06-12 12:38:37 +00:00
|
|
|
|
|
|
|
diff tools.txt tools.txt.new && {
|
2023-05-07 14:38:08 +00:00
|
|
|
echo "Up to date"
|
|
|
|
rm tools.txt.new
|
|
|
|
exit 0
|
2019-06-12 12:38:37 +00:00
|
|
|
} || true
|
|
|
|
|
|
|
|
mv tools.txt.new tools.txt
|
|
|
|
updpkgsums
|
|
|
|
|
|
|
|
makepkg --printsrcinfo >.SRCINFO
|
|
|
|
|
|
|
|
git add tools.txt .SRCINFO PKGBUILD
|
2019-07-09 22:19:44 +00:00
|
|
|
git commit -m "Update tools $(date +%Y.%m.%d)"
|