Skip to content

Commit cc16f4b

Browse files
committed
Add explicit suite mapping for Debian and Ubuntu
Introduces explicit mapping of distro codenames to repository suites for Debian and Ubuntu, with fallbacks for newer or unknown releases. This ensures proper repository setup even when upstream does not yet support the latest distributions.
1 parent 1e679be commit cc16f4b

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

misc/tools.func

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,51 @@ manage_tool_repository() {
450450
# Setup repository
451451
local distro_codename
452452
distro_codename=$(awk -F= '/^VERSION_CODENAME=/{print $2}' /etc/os-release)
453-
suite=$(get_fallback_suite "$distro_id" "$distro_codename" "$repo_url")
453+
454+
# Suite mapping with fallback for newer releases not yet supported by upstream
455+
if [[ "$distro_id" == "debian" ]]; then
456+
case "$distro_codename" in
457+
trixie | forky | sid)
458+
# Testing/unstable releases fallback to latest stable suite
459+
suite="bookworm"
460+
;;
461+
bookworm)
462+
suite="bookworm"
463+
;;
464+
bullseye)
465+
suite="bullseye"
466+
;;
467+
*)
468+
# Unknown release: fallback to latest stable suite
469+
msg_warn "Unknown Debian release '${distro_codename}', using bookworm"
470+
suite="bookworm"
471+
;;
472+
esac
473+
elif [[ "$distro_id" == "ubuntu" ]]; then
474+
case "$distro_codename" in
475+
oracular | plucky)
476+
# Newer releases fallback to latest LTS
477+
suite="noble"
478+
;;
479+
noble)
480+
suite="noble"
481+
;;
482+
jammy)
483+
suite="jammy"
484+
;;
485+
focal)
486+
suite="focal"
487+
;;
488+
*)
489+
# Unknown release: fallback to latest LTS
490+
msg_warn "Unknown Ubuntu release '${distro_codename}', using noble"
491+
suite="noble"
492+
;;
493+
esac
494+
else
495+
# For other distros, try generic fallback
496+
suite=$(get_fallback_suite "$distro_id" "$distro_codename" "$repo_url")
497+
fi
454498

455499
repo_component="main"
456500
[[ "$distro_id" == "ubuntu" ]] && repo_component="multiverse"

0 commit comments

Comments
 (0)