From 6a5ffd834763a2ddef7806b86883d86544af8099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 9 Apr 2025 19:36:08 +0200 Subject: [PATCH] Manage /etc/apt/sources.list.d/yunohost.sources as deb822 for switchto* --- switchtoStable | 4 ++++ switchtoTesting | 4 ++++ switchtoUnstable | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/switchtoStable b/switchtoStable index b7fb3e7..c79cae8 100644 --- a/switchtoStable +++ b/switchtoStable @@ -6,6 +6,10 @@ Patching sources.list to disable testing repository... ---- EOF +if [ -f "/etc/apt/sources.list.d/yunohost.sources" ]; then + sed -i 's|^\s*Components\s*:\s*.*$|Components: stable|' "/etc/apt/sources.list.d/yunohost.sources" +fi + readarray -d '' apt_files < <(find /etc/apt/sources.list /etc/apt/sources.list.d -type f -print0) for FILE in "${apt_files[@]}"; do # Remove 'testing' and 'unstable' in lines using the yunohost repo diff --git a/switchtoTesting b/switchtoTesting index 6869ade..e63211d 100644 --- a/switchtoTesting +++ b/switchtoTesting @@ -6,6 +6,10 @@ Patching sources.list to enable testing repository... ---- EOF +if [ -f "/etc/apt/sources.list.d/yunohost.sources" ]; then + sed -i 's|^\s*Components\s*:\s*.*$|Components: testing|' "/etc/apt/sources.list.d/yunohost.sources" +fi + readarray -d '' apt_files < <(find /etc/apt/sources.list /etc/apt/sources.list.d -type f -print0) for FILE in "${apt_files[@]}"; do # (Append 'testing' at the end of lines starting with the yunohost repo..) diff --git a/switchtoUnstable b/switchtoUnstable index fd1a9e0..f4ca92e 100644 --- a/switchtoUnstable +++ b/switchtoUnstable @@ -6,6 +6,10 @@ Patching sources.list to enable unstable repository... ---- EOF +if [ -f "/etc/apt/sources.list.d/yunohost.sources" ]; then + sed -i 's|^\s*Components\s*:\s*.*$|Components: testing unstable|' "/etc/apt/sources.list.d/yunohost.sources" +fi + readarray -d '' apt_files < <(find /etc/apt/sources.list /etc/apt/sources.list.d -type f -print0) for FILE in "${apt_files[@]}"; do # (Append 'testing' at the end of lines starting with the yunohost repo..)