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)
This commit is contained in:
Viacheslav Bocharov 2025-12-22 16:30:54 +03:00 committed by Igor
parent 8f6e41e84a
commit 492b96aeeb

View File

@ -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