From 23703fa134b3d1d8b910ac4244044864fe9e67ed Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Wed, 7 Aug 2024 11:57:19 +0200 Subject: [PATCH] new: [base-0k] deactivate security sources that are not anymore supported ``stretch`` doesn't offer anymore a ``stretch/updates`` on http://security.debian.org --- precise/base-0k/hooks/install.d/00-base.sh | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/precise/base-0k/hooks/install.d/00-base.sh b/precise/base-0k/hooks/install.d/00-base.sh index 66a309c..9b1606e 100755 --- a/precise/base-0k/hooks/install.d/00-base.sh +++ b/precise/base-0k/hooks/install.d/00-base.sh @@ -70,7 +70,31 @@ apt:update() { /etc/apt/sources.list #s,^(deb(-src)? http://deb.debian.org/debian '"$variant"'),#\1,' \ fi + if [[ " ${tried[*]} " != *" ${variant}-archive-comment-out "* ]] && + [[ "$failed_fetch" == *" http://archive.debian.org/debian/dists/$variant/"* ]]; then + tried+=("${variant}-archive-comment-out") + [ -z "$backup" ] && { + backup=1 + echo "Backup old /etc/apt/sources.list" + cp -v /etc/apt/sources.list{,.myc-update} + } + echo "Applying ${variant}-archive-comment-out" + sed -ri 's,^(deb(-src)? http://archive.debian.org/debian '"$variant"'),#\1,g' \ + /etc/apt/sources.list + fi done + if [[ " ${tried[*]} " != *" ${variant}-security-comment-out "* ]] && + [[ "$failed_release" == *"'http://security.debian.org $distrib/updates "* ]]; then + tried+=("${distrib}-comment-out") + [ -z "$backup" ] && { + backup=1 + echo "Backup old /etc/apt/sources.list" + cp -v /etc/apt/sources.list{,.myc-update} + } + echo "Applying $distrib}-comment-out" + sed -ri 's,^(deb(-src)? http://security.debian.org/ '"$distrib/updates"'),#\1,g' \ + /etc/apt/sources.list + fi done if [[ " ${tried[*]} " != *" change-release-fix "* ]] &&