From ae333c5258afc097263f2f92dd083453aff690a7 Mon Sep 17 00:00:00 2001 From: Flashwalker Date: Sat, 12 Nov 2022 05:27:40 +0700 Subject: [PATCH] Optimisation of apt update: update only added repo during install action (#657) --- deb-get | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/deb-get b/deb-get index 1bcd5fb94..08d689db9 100755 --- a/deb-get +++ b/deb-get @@ -222,10 +222,17 @@ function upgrade_apt() { ${ELEVATE} apt-get -q -o Dpkg::Progress-Fancy="1" -y upgrade } +# Update only the added repo (during install action) +function update_only_repo() { + fancy_message info "Upating: /etc/apt/sources.list.d/${APT_LIST_NAME}.list" + ${ELEVATE} apt-get update -o Dir::Etc::sourcelist="sources.list.d/${APT_LIST_NAME}.list" \ + -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" +} + function install_apt() { ((PACKAGE_INSTALLATION_TRIES++)) add_apt_repo - if ! update_apt; then + if ! update_only_repo; then remove_repo return fi