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>
This commit is contained in:
Copilot
2026-03-07 15:44:33 +01:00
committed by GitHub
parent acedb5fb55
commit ff4648b7f3

View File

@@ -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 <<EOF >/etc/apt/preferences.d/preferences
Package: *
Pin: release a=unstable