From 6d7c318decd84cc959342590579faa3560545eef Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 22 Oct 2025 16:32:15 +0200 Subject: [PATCH] Fix MongoDB repo suite handling for new Debian versions Adds explicit mapping of 'trixie', 'forky', and 'sid' to 'bookworm' for MongoDB repository setup. Improves error handling by failing early if the repository is unavailable, instead of attempting a fallback. --- misc/tools.func | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/misc/tools.func b/misc/tools.func index 9eb43150e..518522f11 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -2382,14 +2382,19 @@ function setup_mongodb() { cleanup_old_repo_files "mongodb-org-${MONGO_VERSION}" cleanup_orphaned_sources - # Determine working suite dynamically via helper local SUITE - SUITE=$(get_fallback_suite "$DISTRO_ID" "$DISTRO_CODENAME" "$MONGO_BASE_URL") + case "$DISTRO_CODENAME" in + trixie | forky | sid) + SUITE="bookworm" + ;; + *) + SUITE=$(get_fallback_suite "$DISTRO_ID" "$DISTRO_CODENAME" "$MONGO_BASE_URL") + ;; + esac - # Double-check availability (handles future distro changes automatically) if ! verify_repo_available "$MONGO_BASE_URL" "$SUITE"; then - msg_warn "MongoDB repo not found for ${DISTRO_ID}-${SUITE}, falling back via get_fallback_suite" - SUITE=$(get_fallback_suite "$DISTRO_ID" "$SUITE" "$MONGO_BASE_URL") + msg_error "MongoDB repository not available for ${DISTRO_ID}-${SUITE}" + return 1 fi mkdir -p /etc/apt/keyrings