From 284691700b2ea43fb60aa16eb62b917f392796b1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 22:27:44 +0000 Subject: [PATCH] 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> --- 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