From ff4648b7f38ff9ee7bdf9261a68e280f4c8881cd Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Mar 2026 15:44:33 +0100 Subject: [PATCH] fix(immich): fix update script failing to add Debian testing repo when preferences file already exists (#12631) * Initial plan * fix(immich): fix testing repo not being added during update when preferences file already exists Co-authored-by: michelroegl-brunner <73236783+michelroegl-brunner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: michelroegl-brunner <73236783+michelroegl-brunner@users.noreply.github.com> --- ct/immich.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ct/immich.sh b/ct/immich.sh index e2f2e01a8..4050d0525 100644 --- a/ct/immich.sh +++ b/ct/immich.sh @@ -36,9 +36,13 @@ function update_script() { exit fi - if [[ ! -f /etc/apt/preferences.d/preferences ]]; then + if ! grep -qE '(^|[[:space:]])testing([[:space:]]|$)' /etc/apt/sources.list.d/debian.sources 2>/dev/null; then msg_info "Adding Debian Testing repo" - sed -i 's/ trixie-updates/ trixie-updates testing/g' /etc/apt/sources.list.d/debian.sources + if grep -q "trixie-updates" /etc/apt/sources.list.d/debian.sources 2>/dev/null; then + sed -i 's/ trixie-updates/ trixie-updates testing/g' /etc/apt/sources.list.d/debian.sources + else + sed -i '/^[[:space:]]*Suites:.*trixie/ s/$/ testing/' /etc/apt/sources.list.d/debian.sources + fi cat </etc/apt/preferences.d/preferences Package: * Pin: release a=unstable