~ubuntu-core-dev/update-notifier/ubuntu

« back to all changes in this revision

Viewing changes to data/apt_check.py

  • Committer: Julian Andres Klode
  • Date: 2019-04-25 10:52:42 UTC
  • Revision ID: juliank@ubuntu.com-20190425105242-cdebau10hmmln5l6
Fix multiple disabled ESM repositories being counted as enabled ones.

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
    for file in cache.file_list:
195
195
        if file.origin == "UbuntuESM" and file.archive.startswith(DISTRO):
196
196
            # In case of multiple ESM repos, one enabled is sufficient.
197
 
            if (have_esm is None
198
 
                    and depcache.policy.get_priority(file) == -32768):
199
 
                have_esm = False
 
197
            if depcache.policy.get_priority(file) == -32768:
 
198
                # We found a disabled ESM repository, but we'll only count
 
199
                # ESM as disabled here if we have not found any other ESM
 
200
                # repo, so one ESM repo being enabled means ESM is enabled.
 
201
                if have_esm is None:
 
202
                    have_esm = False
200
203
            else:
201
204
                have_esm = True
202
205
                break