Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Optimisation of apt update: update only added repo during install action #657

Merged
merged 2 commits into from
Nov 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion deb-get
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down