From fc8f8ef7fbe9105cb6c9c20ce479cd47439bcf01 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 24 Jul 2025 13:11:35 +0200 Subject: [PATCH] Update tools.func --- misc/tools.func | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/misc/tools.func b/misc/tools.func index a848a2a0..0edc8a46 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -881,37 +881,43 @@ function fetch_and_deploy_gh_release() { cp -r "$unpack_dir"/* "$target/" shopt -u dotglob nullglob - ### Binary Mode ### + ### Binary Mode ### elif [[ "$mode" == "binary" ]]; then local arch arch=$(dpkg --print-architecture 2>/dev/null || uname -m) [[ "$arch" == "x86_64" ]] && arch="amd64" - #[[ "$arch" == "aarch64" ]] && arch="arm64" + [[ "$arch" == "aarch64" ]] && arch="arm64" local assets url_match="" assets=$(echo "$json" | jq -r '.assets[].browser_download_url') - # If explicit filename pattern is provided (param $6), match that first + # 1. Expliziten Pattern-Parameter bevorzugen if [[ -n "$asset_pattern" ]]; then for u in $assets; do - [[ "$u" =~ $asset_pattern || "$u" == *"$asset_pattern" ]] && url_match="$u" && break - done - fi - - # If no match via explicit pattern, fall back to architecture heuristic - if [[ -z "$url_match" ]]; then - for u in $assets; do - if [[ "$u" =~ ($arch|amd64|x86_64|aarch64|arm64).*\.deb$ ]]; then + if [[ "$u" =~ $asset_pattern || "$u" == *"$asset_pattern" ]]; then url_match="$u" break fi done fi - # Fallback: any .deb file + # 2. Wenn kein Pattern-Match, gezielt nach Architektur suchen if [[ -z "$url_match" ]]; then for u in $assets; do - [[ "$u" =~ \.deb$ ]] && url_match="$u" && break + if [[ "$u" == *"${arch}"* && "$u" == *.deb ]]; then + url_match="$u" + break + fi + done + fi + + # 3. Fallback: irgendein .deb + if [[ -z "$url_match" ]]; then + for u in $assets; do + if [[ "$u" == *.deb ]]; then + url_match="$u" + break + fi done fi