From ba7c46aae8a563268717300b197deefe6d1b9985 Mon Sep 17 00:00:00 2001 From: Orazio Date: Fri, 29 May 2020 15:56:43 +0200 Subject: [PATCH] Avoid hardcoding distribution codenames - Actually check for apt >= 1.5 instead of checking for distributions known for having a newer package --- auto_install/install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index dae00c4..1b4f62c 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -458,10 +458,11 @@ notifyPackageUpdatesAvailable(){ } preconfigurePackages(){ - # Add support for https repositories that will be used later on + # If apt is older than 1.5 we need to install an additional package to add + # support for https repositories that will be used later on if [[ -f /etc/apt/sources.list ]]; then - # buster and bionic have apt >= 1.5 which has https support built in - if [[ ${OSCN} != "buster" ]] && [[ ${OSCN} != "bionic" ]]; then + INSTALLED_APT="$(apt-cache policy apt | grep -m1 'Installed: ' | grep -v '(none)' | awk '{print $2}')" + if dpkg --compare-versions "$INSTALLED_APT" lt 1.5; then BASE_DEPS+=("apt-transport-https") fi fi