From 492b96aeeb251e52b86408d59366a29eabf34adc Mon Sep 17 00:00:00 2001 From: Viacheslav Bocharov Date: Mon, 22 Dec 2025 16:30:54 +0300 Subject: [PATCH] fix(apt-utils): add fallback for Ubuntu LTS releases without -updates suffix in JSON Problem: armbian-base-files artifact for jammy fails to build because apt_find_upstream_package_version_and_download_url() looks for 'jammy-updates' in https://github.armbian.com/base-files.json, but only 'jammy' key exists. Root cause: - For Ubuntu LTS (focal, jammy), code sets package_download_release to '${RELEASE}-updates' - JSON file from github.armbian.com only has base release keys (jammy, noble, etc) - jq query returns null for 'jammy-updates' - Artifact excluded from build matrix after 10 retries Solution: Add fallback logic - First try with '-updates' suffix (jammy-updates) - If not found and release ends with '-updates', retry with base release (jammy) - This allows using base release data when -updates is not available Impact: - Fixes jammy base-files artifact build - Allows jammy images to build (they depend on this artifact) - Maintains preference for -updates when available - No impact on other releases (Debian, non-LTS Ubuntu) --- lib/functions/general/apt-utils.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/functions/general/apt-utils.sh b/lib/functions/general/apt-utils.sh index 99bb5ffaee..9603633b58 100644 --- a/lib/functions/general/apt-utils.sh +++ b/lib/functions/general/apt-utils.sh @@ -58,6 +58,16 @@ function apt_find_upstream_package_version_and_download_url() { '.[$release][$arch]' $package_info_download_url_file ) + # Fallback for Ubuntu LTS releases: if not found with -updates suffix, try without it + if [[ "${found_package_filename}" != "${sought_package_name}_"* ]] && [[ "${DISTRIBUTION}" == "Ubuntu" ]] && [[ "${package_download_release}" == *"-updates" ]]; then + display_alert "Package not found with '-updates' suffix, trying without it" "${package_download_release} -> ${RELEASE}" "wrn" + package_download_release="${RELEASE}" + found_package_filename=$( + jq -r --arg release "${package_download_release}" --arg arch "${ARCH}" \ + '.[$release][$arch]' $package_info_download_url_file + ) + fi + if [[ "${found_package_filename}" == "${sought_package_name}_"* ]]; then display_alert "Found upstream base-files package filename" "${found_package_filename}" "info" else