From d8b0e22052370ee008935b16864b2058dfceecd9 Mon Sep 17 00:00:00 2001 From: bcherb2 Date: Wed, 18 Nov 2026 02:45:18 -0500 Subject: [PATCH] fix: a gh: deb missing from the latest release comes from the newest one that has it ghostty-ubuntu 1.4.0 builds for 26.04 and later only, so apps/ghostty failed on every fresh 24.04 box with "no release asset matching". Fall back to the release list, newest first. --- .tests/fakebin/_curl | 9 +++++++++ .tests/test.sh | 10 ++++++++++ dot_local/bin/executable_dotup | 6 ++++++ 3 files changed, 25 insertions(+) diff --git a/.tests/fakebin/_curl b/.tests/fakebin/_curl index f57ee59..a6bb362 100644 --- a/.tests/fakebin/_curl +++ b/.tests/fakebin/_curl @@ -82,6 +82,15 @@ https://github.com/ryanoasis/nerd-fonts/releases/latest/download/*.tar.xz) tar -cJf - -C "$d" . | emit; rm -rf "$d"; exit 0 ;; *go.dev/VERSION*) echo go1.99.0; exit 0 ;; +# ghostty-ubuntu's shape after 1.4.0: the latest release builds only for newer +# Ubuntu, and the asset for this machine's release is in an older one. +*api.github.com/repos/mkasberg/ghostty-ubuntu/releases/latest) + echo ' "browser_download_url": "https://example.invalid/ghostty_9.9-0.ppa1_amd64_99.99.deb"'; exit 0 ;; +*api.github.com/repos/mkasberg/ghostty-ubuntu/releases[?]*) + v=$( . /etc/os-release 2>/dev/null; printf '%s' "${VERSION_ID:-}" ) + echo ' "browser_download_url": "https://example.invalid/ghostty_9.9-0.ppa1_amd64_99.99.deb"' + echo " \"browser_download_url\": \"https://example.invalid/ghostty_9.8-0.ppa1_amd64_$v.deb\"" + echo " \"browser_download_url\": \"https://example.invalid/ghostty_9.7-0.ppa1_amd64_$v.deb\""; exit 0 ;; *api.github.com*) echo ' "browser_download_url": "https://example.invalid/fake_amd64.deb"'; exit 0 ;; diff --git a/.tests/test.sh b/.tests/test.sh index bcc20ca..4bccf8d 100755 --- a/.tests/test.sh +++ b/.tests/test.sh @@ -1232,6 +1232,16 @@ is "a failed download installs nothing" "0" \ "$(grep -c 'apt-get install -y .*\.deb' "$LOG" || true)" has "…and is reported against the package" "apps/chrome" "$out" +# ghostty-ubuntu 1.4.0 dropped the 24.04 build, so `latest` carries no asset +# for this machine and apps/ghostty failed on every fresh 24.04 box. The newest +# release that does carry one is what gets installed. +GHV=$( . /etc/os-release 2>/dev/null; printf '%s' "${VERSION_ID:-}" ) +newbox; pick apps/ghostty +out=$(box install 2>&1 | plain || true) +has "a gh: deb missing from latest comes from the newest release that has it" \ + "https://example.invalid/ghostty_9.8-0.ppa1_amd64_$GHV.deb" "$(cat "$LOG")" +hasnt "…and is not reported as missing" "no release asset matching" "$out" + printf '\n\033[1mthe neovim tarball lands where the symlink points\033[0m\n' # Four commands name the same directory: the rm, the mkdir, tar's -C, and the # symlink's target. A typo in any one of them installs nothing and leaves a diff --git a/dot_local/bin/executable_dotup b/dot_local/bin/executable_dotup index 936f780..1ea922c 100755 --- a/dot_local/bin/executable_dotup +++ b/dot_local/bin/executable_dotup @@ -793,6 +793,12 @@ install_deb() { else url=$(curl -fsSL "https://api.github.com/repos/$repo/releases/latest" 2>/dev/null \ | awk -F'"' -v m="$match" '/browser_download_url/ && index($4,m) {print $4; exit}') + # A distro build can stop at some release: ghostty-ubuntu 1.4.0 + # ships 26.04 and later only, so `latest` has no 24.04 asset and + # the newest one that does is 1.3.1. The list is newest first, so + # the first match is the newest release built for this machine. + [ -n "$url" ] || url=$(curl -fsSL "https://api.github.com/repos/$repo/releases?per_page=30" 2>/dev/null \ + | awk -F'"' -v m="$match" '/browser_download_url/ && index($4,m) {print $4; exit}') [ -n "$url" ] || { note_fail "$(keyof deb "$s")" "no release asset matching *$match*"; continue; } fi ;; esac