linuxmint / mintupdate

The Linux Mint Update Manager
320 stars 156 forks source link

No kernel changelogs becase of wrong URL: source name should be "linux", not "linux-meta" #705

Closed dqgls closed 3 months ago

dqgls commented 3 years ago

Describe the bug Currently Mint Update is unable to retrieve changelogs for Linux kernel updates. That is because wrong URL is used, specifically the name of the source package: it should be "linux", not "linux-meta". For example:

To Reproduce Steps to reproduce the behavior:

  1. Click a "Linux kernel" update (when available)
  2. Click on the "Changelog" tab

Expected behavior Changelog should be displayed.

Distribution: Linux Mint 20.2

Software version: 5.7.8

Logs:

Trying to fetch the changelog from: http://changelogs.ubuntu.com/changelogs/pool/main/l/linux-meta/linux-meta_5.4.0-88.99/changelog
Trying to fetch the changelog from: http://changelogs.ubuntu.com/changelogs/pool/multiverse/l/linux-meta/linux-meta_5.4.0-88.99/changelog
Trying to fetch the changelog from: http://changelogs.ubuntu.com/changelogs/pool/universe/l/linux-meta/linux-meta_5.4.0-88.99/changelog
Trying to fetch the changelog from: http://changelogs.ubuntu.com/changelogs/pool/restricted/l/linux-meta/linux-meta_5.4.0-88.99/changelog

Additional context It is also unnecessary to blindly try fetching 4 different changelog.ubuntu.com URLs. You can extract the correct path from the apt.package.Version object. Here's a function that I use in my own changelog retriever:

def url_ubuntu(version):                                                        
    url = 'https://changelogs.ubuntu.com/changelogs/{path}/{name}_{ver}/changelog'
    path = version.filename.rsplit('/', 1)[0]  # extract dirname                
    name = version.source_name                                                  
    ver = version.source_version.split(':', 1)[-1]  # remove epoch              
    return url.format(path=path, name=name, ver=ver)