diff --git a/compile.conf b/compile.conf index d7f07c7..8e9730a 100644 --- a/compile.conf +++ b/compile.conf @@ -6,8 +6,14 @@ # git= - git repository URL to clone (mutually exclusive with wget). Builds the # tag named after the version (1.2.3 or v1.2.3), or the default branch # if the repo has no tags -# ref= - commit to build instead of the version's tag, for repos whose tags are wrong -# wget= - URL of a zip/tar archive to download and extract (mutually exclusive with git) +# ref= - commit to build instead of the version's tag, for repos whose tags are +# wrong or that have no tags. hampackcheck compares it with upstream HEAD +# for repos without version tags. Change version= along with it, or the +# new commit isn't built +# wget= - URL of a zip/tar archive to download and extract (mutually exclusive with git). +# For an archive with no version number, use the date it was released +# (YYYY-MM-DD, from its Last-Modified header) as version=, and +# hampackcheck checks it for you # install= - path to the installed binary, used to detect if already installed (required) # steps= - comma-separated build commands, run in order from a private copy of # the source (required). A step that fails stops the build, and the @@ -49,14 +55,18 @@ git=https://github.com/kiwix/kiwix-tools.git install=$HOME/.local/bin/kiwix-serve steps=meson setup build --prefix=$HOME/.local, ninja -C build, DESTDIR=$PWD/stage ninja -C build install, install_staged stage +# No tags upstream, so pinned to a commit [Dump1090] version=1.0.0 git=https://github.com/antirez/dump1090.git +ref=efe64db3c6ba1520291331628a33c1e208e851a6 install=$HOME/.local/bin/dump1090 steps=make, mv dump1090 $HOME/.local/bin/dump1090 +# YAAC.zip always holds the latest release and carries no version number, +# so version= is the zip's release date [yaac] -version=1.0-beta229 +version=2026-11-07 wget=https://www.ka2ddo.org/ka2ddo/YAAC.zip install=$HOME/.local/bin/yaac/YAAC.jar desktop=$HAMPACK_DIR/desktop/yaac.desktop @@ -64,7 +74,7 @@ gui=true steps=rm -rf $HOME/.local/bin/yaac, mkdir -p $HOME/.local/bin/yaac, mv ./* $HOME/.local/bin/yaac/ [potacat] -version=1.11.7 +version=1.14.1 git=https://github.com/Waffleslop/POTACAT.git install=$HOME/.local/bin/POTACAT.AppImage desktop=$HAMPACK_DIR/desktop/potacat.desktop diff --git a/hampackcheck b/hampackcheck index 95df264..5cce5dc 100755 --- a/hampackcheck +++ b/hampackcheck @@ -60,14 +60,37 @@ check_binary() { fi } +# Date (YYYY-MM-DD, UTC) a URL was last modified, from its Last-Modified header +last_modified_date() { + local header + header="$(curl -sfIL "$1" | sed -n 's/^[Ll]ast-[Mm]odified: *//p' | tail -n1 | tr -d '\r')" + [ -n "$header" ] && date -u -d "$header" +%F +} + # parse_conf callback for compile.conf. git= apps are built from the tag # matching their version, so compare against the repo's tags, not releases. +# Repos without version tags are compared by their pinned ref= against HEAD, +# and archives versioned by date by their Last-Modified date. check_compiled() { - local app="${CONF[name]:-${CONF[_name]}}" version="${CONF[version]}" + local app="${CONF[name]:-${CONF[_name]}}" version="${CONF[version]}" ref="${CONF[ref]}" [ -n "$version" ] || return 0 if [ -n "${CONF[git]}" ]; then - print_result "$app" "$version" "$(git_latest_tag "${CONF[git]}")" "" "version tags" + local latest + latest="$(git_latest_tag "${CONF[git]}")" + if [ -z "$latest" ] && [ -n "$ref" ]; then + local head + head="$(git ls-remote "${CONF[git]}" HEAD 2> /dev/null | cut -f1)" + if [ "$head" = "$ref" ]; then + print_result "$app" "$version" "$version" "" + else + print_result "$app" "$version" "${head:+HEAD ${head:0:10}}" "" "git HEAD" + fi + else + print_result "$app" "$version" "$latest" "" "version tags" + fi + elif [[ "$version" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then + print_result "$app" "$version" "$(last_modified_date "${CONF[wget]}")" "" "Last-Modified" else print_result "$app" "$version" "" "${CONF[wget]}" fi