Skip to content

Commit

Permalink
No need to test if package is installed for upgradable packages
Browse files Browse the repository at this point in the history
Signed-off-by: kennethso168 <[email protected]>
  • Loading branch information
kennethso168 authored Apr 27, 2024
1 parent e1c436e commit 51bb32c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions apt_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,8 @@ def _convert_candidates_to_upgrade_infos(candidates):


def _write_pending_upgrades(registry, cache):
# Discount any changes that apply to packages that aren't installed (e.g.
# count an upgrade to package A that adds a new dependency on package B as
# only one upgrade, not two). See the following issue for more details:
# https://github.com/prometheus-community/node-exporter-textfile-collector-scripts/issues/85
candidates = {
p.candidate for p in cache if p.is_installed and p.is_upgradable
p.candidate for p in cache if p.is_upgradable
}
upgrade_list = _convert_candidates_to_upgrade_infos(candidates)

Expand Down

0 comments on commit 51bb32c

Please sign in to comment.