From e497cb23bc85f83f3d829f768c11fb0b912d10e1 Mon Sep 17 00:00:00 2001 From: Andrey Miroshnikov Date: Sun, 12 Sep 2021 21:02:40 +0100 Subject: [PATCH] Added check to see if brokenproxy apt fix was already done previously on host debian system --- mk-deb-chroot | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/mk-deb-chroot b/mk-deb-chroot index a30ef30..c432d3f 100755 --- a/mk-deb-chroot +++ b/mk-deb-chroot @@ -21,16 +21,27 @@ echo "Creating chroot dir '$chrootdir'" mkdir /opt/chroot/$chrootdir # argh apt with broken proxies and unreliable ISPs, getting fed up with it -cat </tmp/brokenproxy +if [ -e /tmp/brokenproxy ]; then + echo "Temp file containing apt proxy fix configuration already exists, skipping!" +else + cat </tmp/brokenproxy APT::Acquire::Retries "20"; APT::Get::Fix-Broken "true"; Acquire::http::Pipeline-Depth "0"; Acquire::http::No-Cache=True; Acquire::BrokenProxy=true; EOF +fi + +if [ -e /etc/apt/apt.conf.d/80-retries ]; then + echo "Host system apt.conf.d already has 80-retries, skipping!" +else + cp /tmp/brokenproxy /etc/apt/apt.conf.d/80-retries +fi + +# No need to check if exists, this script always runs with new chroot +cp /tmp/brokenproxy /opt/chroot/$chrootdir/etc/apt/apt.conf.d/80-retries -cp /tmp/brokenproxy /etc/apt/apt.conf.d/80-retries -cp /tmp/brokenproxy /opt/chroot/coriolis/etc/apt/apt.conf.d/80-retries # Install debootstrap and schroot if [ -e /etc/debian_version ]; then -- 2.30.2