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.
This commit is contained in:
1 parent
0a5ec74fa5
commit
d8b0e22052
3 files changed
+25
No files matched your search
@@ -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 ;;
|
tar -cJf - -C "$d" . | emit; rm -rf "$d"; exit 0 ;;
|
||||||
*go.dev/VERSION*)
|
*go.dev/VERSION*)
|
||||||
echo go1.99.0; exit 0 ;;
|
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*)
|
*api.github.com*)
|
||||||
echo ' "browser_download_url": "https://example.invalid/fake_amd64.deb"'; exit 0 ;;
|
echo ' "browser_download_url": "https://example.invalid/fake_amd64.deb"'; exit 0 ;;
|
||||||
|
|
||||||
|
|||||||
@@ -1232,6 +1232,16 @@ is "a failed download installs nothing" "0" \
|
|||||||
"$(grep -c 'apt-get install -y .*\.deb' "$LOG" || true)"
|
"$(grep -c 'apt-get install -y .*\.deb' "$LOG" || true)"
|
||||||
has "…and is reported against the package" "apps/chrome" "$out"
|
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'
|
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
|
# 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
|
# symlink's target. A typo in any one of them installs nothing and leaves a
|
||||||
|
|||||||
@@ -793,6 +793,12 @@ install_deb() {
|
|||||||
else
|
else
|
||||||
url=$(curl -fsSL "https://api.github.com/repos/$repo/releases/latest" 2>/dev/null \
|
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}')
|
| 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; }
|
[ -n "$url" ] || { note_fail "$(keyof deb "$s")" "no release asset matching *$match*"; continue; }
|
||||||
fi ;;
|
fi ;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in new issue
Block a user