Skip to content

Commit

Permalink
Fix changelog retrieval for linux and linux-hwe kernel updates (#851)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fs00 authored Jun 16, 2024
1 parent 5e66f86 commit a1924e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion usr/lib/linuxmint/mintUpdate/checkAPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 9 additions & 2 deletions usr/lib/linuxmint/mintUpdate/mintUpdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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))
Expand All @@ -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))
Expand Down

0 comments on commit a1924e4

Please sign in to comment.