From 754b3d4b6b097f8ae9757d82f297c115b8fba255 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Tue, 10 Feb 2026 14:42:13 +0100 Subject: [PATCH] fix: add Debian codename matching for binary mode in fetch_and_deploy_gh_release --- misc/tools.func | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/misc/tools.func b/misc/tools.func index 82895bce0..40ad30a2b 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -1974,6 +1974,12 @@ function fetch_and_deploy_gh_release() { [[ "$arch" == "x86_64" ]] && arch="amd64" [[ "$arch" == "aarch64" ]] && arch="arm64" + # Get Debian codename for distro-specific packages + local codename="" + if [[ -f /etc/os-release ]]; then + codename=$(grep -oP '(?<=VERSION_CODENAME=).*' /etc/os-release 2>/dev/null || true) + fi + local assets url_match="" assets=$(echo "$json" | jq -r '.assets[].browser_download_url') @@ -1989,7 +1995,17 @@ function fetch_and_deploy_gh_release() { done fi - # If no match via explicit pattern, fall back to architecture heuristic + # If no match via explicit pattern, try architecture + codename match + if [[ -z "$url_match" && -n "$codename" ]]; then + for u in $assets; do + if [[ "$u" =~ $arch.*$codename.*\.deb$ ]] || [[ "$u" =~ $arch.*-$codename\.deb$ ]] || [[ "$u" =~ ${arch}-${codename}\.deb$ ]] || [[ "$u" =~ ${arch}_${codename}\.deb$ ]]; then + url_match="$u" + break + fi + done + fi + + # Fallback: architecture heuristic without codename if [[ -z "$url_match" ]]; then for u in $assets; do if [[ "$u" =~ ($arch|amd64|x86_64|aarch64|arm64).*\.deb$ ]]; then