From 300db370f030f8fec4a4f704b011b29d5824233d Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 21 Oct 2025 10:38:14 +0200 Subject: [PATCH] Update tools.func --- misc/tools.func | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/misc/tools.func b/misc/tools.func index dd8a28b7..2ca6d09e 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -2308,30 +2308,31 @@ function setup_mysql() { # Cleanup old repository files cleanup_old_repo_files "mysql" - # MySQL compatibility check for Debian Trixie - if [[ "$DISTRO_ID" == "debian" && "$DISTRO_CODENAME" =~ ^(trixie|forky|sid)$ ]]; then - msg_error "MySQL is not compatible with Debian ${DISTRO_CODENAME}" - msg_info "Use MariaDB instead: MARIADB_VERSION=\"11.4\" setup_mariadb" - return 1 - fi - - # Determine suite + # Determine suite - use bookworm for Debian testing/unstable local SUITE - case "$DISTRO_CODENAME" in - bookworm | bullseye) - SUITE="$DISTRO_CODENAME" - ;; - *) - # For Ubuntu + if [[ "$DISTRO_ID" == "debian" ]]; then + case "$DISTRO_CODENAME" in + bookworm | bullseye) + SUITE="$DISTRO_CODENAME" + ;; + trixie | forky | sid) + msg_warn "Using MySQL Bookworm packages on Debian ${DISTRO_CODENAME}" + SUITE="bookworm" + ;; + *) + SUITE="bookworm" # Fallback to bookworm for unknown Debian versions + ;; + esac + else + # For Ubuntu - use fallback detection SUITE=$(get_fallback_suite "$DISTRO_ID" "$DISTRO_CODENAME" "https://repo.mysql.com/apt/${DISTRO_ID}") - ;; - esac + fi # Stop existing MySQL if running $STD systemctl stop mysql 2>/dev/null || true # Only purge if MySQL is actually installed - if dpkg -l | grep -q "^ii.*mysql-server"; then + if dpkg -l 2>/dev/null | grep -q "^ii.*mysql-server"; then $STD apt purge -y mysql-server* mysql-client* mysql-common 2>/dev/null || true fi