From: Andrey Miroshnikov Date: Sun, 12 Sep 2021 20:02:40 +0000 (+0100) Subject: Added check to see if brokenproxy apt fix was already done previously on host debian... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e497cb23bc85f83f3d829f768c11fb0b912d10e1;p=dev-env-setup.git Added check to see if brokenproxy apt fix was already done previously on host debian system --- 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