diff --git a/data/apt_check.py b/data/apt_check.py index 4051460..505251d 100755 --- a/data/apt_check.py +++ b/data/apt_check.py @@ -16,6 +16,8 @@ DISTRO = subprocess.check_output( ["lsb_release", "-c", "-s"], universal_newlines=True).strip() +ESM_ORIGINS = ("UbuntuESM", "UbuntuESMApps") + def _(msg): return gettext.dgettext("update-notifier", msg) @@ -45,7 +47,8 @@ def saveDistUpgrade(cache, depcache): def isSecurityUpgrade(ver): " check if the given version is a security update (or masks one) " security_pockets = [("Ubuntu", "%s-security" % DISTRO), - ("UbuntuESM", "%s-security" % DISTRO), + ("UbuntuESM", "%s-infra-security" % DISTRO), + ("UbuntuESMApps", "%s-apps-security" % DISTRO), ("gNewSense", "%s-security" % DISTRO), ("Debian", "%s-updates" % DISTRO)] for (file, index) in ver.file_list: @@ -58,7 +61,7 @@ def isSecurityUpgrade(ver): def isESMUpgrade(ver): " check if the given version is a security update (or masks one) " for (file, index) in ver.file_list: - if file.origin == "UbuntuESM" and file.archive.startswith(DISTRO): + if file.origin in esm_origins and file.archive.startswith(DISTRO): return True return False @@ -152,7 +155,7 @@ def has_disabled_esm_security_update(depcache, pkg): break for (file, index) in ver.file_list: - if (file.origin == "UbuntuESM" and file.archive.startswith(DISTRO) + if (file.origin in ESM_ORIGINS and file.archive.startswith(DISTRO) and depcache.policy.get_priority(file) == -32768): return True return False @@ -202,7 +205,7 @@ def run(options=None): # first place. have_esm = None # None == does not exist for file in cache.file_list: - if file.origin == "UbuntuESM" and file.archive.startswith(DISTRO): + if file.origin in ESM_ORIGINS and file.archive.startswith(DISTRO): # In case of multiple ESM repos, one enabled is sufficient. if depcache.policy.get_priority(file) == -32768: # We found a disabled ESM repository, but we'll only count