sibling requirements

This commit is contained in:
David Young
2026-10-20 06:21:18 -06:00
parent b7c7b6f6e8
commit 1a8bdda0aa
8 changed files with 142 additions and 37 deletions
+33 -3
View File
@@ -24,16 +24,29 @@ github_latest() {
| sed 's/^v//'
}
# Latest release tag in a git repo, stripping leading "v". Only plain version
# tags count (1.2.3 or v1.2.3), not pre-releases like 1.8-beta1.
git_latest_tag() {
local url="$1"
git ls-remote --tags --refs "$url" 2>/dev/null \
| sed 's|.*refs/tags/||' \
| grep -E '^v?[0-9]+(\.[0-9]+)+$' \
| sed 's/^v//' \
| sort -V \
| tail -n1
}
print_result() {
local app="$1"
local pinned="$2"
local latest="$3"
local manual_url="$4"
local source="${5:-GitHub API}"
if [ -n "$manual_url" ]; then
printf " %-20s pinned=%-15s (manual check: %s)\n" "$app" "$pinned" "${manual_url%/*}"
elif [ -z "$latest" ]; then
printf " %-20s pinned=%-15s (GitHub API unavailable)\n" "$app" "$pinned"
printf " %-20s pinned=%-15s (%s unavailable)\n" "$app" "$pinned" "$source"
elif [ "$pinned" = "$latest" ]; then
printf " %-20s up to date (%s)\n" "$app" "$pinned"
else
@@ -82,6 +95,23 @@ check_binaries() {
check_app "$app" "$version" "$url" ""
}
# compile.conf builds git= apps from the tag matching their version, so compare
# against the repo's tags rather than GitHub releases
check_compiled_app() {
local app="$1"
local version="$2"
local git_url="$3"
local wget_url="$4"
[ -z "$app" ] || [ -z "$version" ] && return
if [ -n "$git_url" ]; then
print_result "$app" "$version" "$(git_latest_tag "$git_url")" "" "version tags"
else
check_app "$app" "$version" "" "$wget_url"
fi
}
check_compiled() {
echo ""
echo "=== compile.conf ==="
@@ -91,7 +121,7 @@ check_compiled() {
[[ -z "$line" || "$line" == \#* ]] && continue
if [[ "$line" =~ ^\[(.+)\]$ ]]; then
check_app "${name:-$app}" "$version" "$git_url" "$wget_url"
check_compiled_app "${name:-$app}" "$version" "$git_url" "$wget_url"
app="${BASH_REMATCH[1]}" name="" version="" git_url="" wget_url=""
continue
fi
@@ -105,7 +135,7 @@ check_compiled() {
esac
done < "$COMPILE_CONF"
check_app "${name:-$app}" "$version" "$git_url" "$wget_url"
check_compiled_app "${name:-$app}" "$version" "$git_url" "$wget_url"
}
# --- Main ---