From a1924e43cb47ec3e73e855b68f319849ce503df2 Mon Sep 17 00:00:00 2001 From: Francesco Saltori Date: Sun, 16 Jun 2024 12:43:04 +0200 Subject: [PATCH] Fix changelog retrieval for linux and linux-hwe kernel updates (#851) --- usr/lib/linuxmint/mintUpdate/checkAPT.py | 2 +- usr/lib/linuxmint/mintUpdate/mintUpdate.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/usr/lib/linuxmint/mintUpdate/checkAPT.py b/usr/lib/linuxmint/mintUpdate/checkAPT.py index 1076b595..4fb8211f 100755 --- a/usr/lib/linuxmint/mintUpdate/checkAPT.py +++ b/usr/lib/linuxmint/mintUpdate/checkAPT.py @@ -169,7 +169,7 @@ def get_kernel_version_from_meta_package(self, pkg): if not dependency.target_versions or dependency.rawtype != "Depends": return None deppkg = dependency.target_versions[0] - if deppkg.source_name in ("linux", "linux-signed"): + if deppkg.source_name in ("linux", "linux-signed") or deppkg.source_name.startswith("linux-hwe"): return deppkg.source_version if deppkg.source_name.startswith("linux-meta"): return self.get_kernel_version_from_meta_package(deppkg) diff --git a/usr/lib/linuxmint/mintUpdate/mintUpdate.py b/usr/lib/linuxmint/mintUpdate/mintUpdate.py index f01f3bc7..aad3749e 100755 --- a/usr/lib/linuxmint/mintUpdate/mintUpdate.py +++ b/usr/lib/linuxmint/mintUpdate/mintUpdate.py @@ -162,6 +162,7 @@ def __init__(self, update, application): self.source_package = update.real_source_name self.version = update.new_version self.origin = update.origin + self.is_kernel_update = update.type == "kernel" self.application = application # get the proxy settings from gsettings self.ps = proxygsettings.get_proxy_settings() @@ -275,7 +276,11 @@ def run(self): changelog_sources.append("http://packages.linuxmint.com/dev/" + self.source_package + "_" + self.version + "_amd64.changes") changelog_sources.append("http://packages.linuxmint.com/dev/" + self.source_package + "_" + self.version + "_i386.changes") elif self.origin == "ubuntu": - if (self.source_package.startswith("lib")): + if self.is_kernel_update: + # Ubuntu HWE kernel versions end with '~' followed by the Ubuntu version (e.g. ~22.04.1). This suffix needs to be removed to get the correct changelog URL + kernel_version = self.version.split("~")[0] + changelog_sources.append("https://changelogs.ubuntu.com/changelogs/pool/main/l/linux/linux_%s/changelog" % (kernel_version)) + elif (self.source_package.startswith("lib")): changelog_sources.append("https://changelogs.ubuntu.com/changelogs/pool/main/%s/%s/%s_%s/changelog" % (self.source_package[0:4], self.source_package, self.source_package, self.version)) changelog_sources.append("https://changelogs.ubuntu.com/changelogs/pool/multiverse/%s/%s/%s_%s/changelog" % (self.source_package[0:4], self.source_package, self.source_package, self.version)) changelog_sources.append("https://changelogs.ubuntu.com/changelogs/pool/universe/%s/%s/%s_%s/changelog" % (self.source_package[0:4], self.source_package, self.source_package, self.version)) @@ -286,7 +291,9 @@ def run(self): changelog_sources.append("https://changelogs.ubuntu.com/changelogs/pool/universe/%s/%s/%s_%s/changelog" % (self.source_package[0], self.source_package, self.source_package, self.version)) changelog_sources.append("https://changelogs.ubuntu.com/changelogs/pool/restricted/%s/%s/%s_%s/changelog" % (self.source_package[0], self.source_package, self.source_package, self.version)) elif self.origin == "debian": - if (self.source_package.startswith("lib")): + if self.is_kernel_update: + changelog_sources.append("https://metadata.ftp-master.debian.org/changelogs/main/l/linux/linux_%s_changelog" % (self.version)) + elif (self.source_package.startswith("lib")): changelog_sources.append("https://metadata.ftp-master.debian.org/changelogs/main/%s/%s/%s_%s_changelog" % (self.source_package[0:4], self.source_package, self.source_package, self.version)) changelog_sources.append("https://metadata.ftp-master.debian.org/changelogs/contrib/%s/%s/%s_%s_changelog" % (self.source_package[0:4], self.source_package, self.source_package, self.version)) changelog_sources.append("https://metadata.ftp-master.debian.org/changelogs/non-free/%s/%s/%s_%s_changelog" % (self.source_package[0:4], self.source_package, self.source_package, self.version))