~ubuntu-core-dev/update-manager/main

« back to all changes in this revision

Viewing changes to UpdateManager/Core/MyCache.py

Use the source version to generate changelog URIs, not the binary version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
221
221
        # use the section of the candidate as a starting point
222
222
        section = pkg._pcache._depcache.get_candidate_ver(pkg._pkg).section
223
223
 
224
 
        # get the source version, start with the binaries version
225
 
        srcver_epoch = pkg.candidate.version
 
224
        # get the source version
 
225
        srcver_epoch = pkg.candidate.source_version
226
226
        srcver = self._strip_epoch(srcver_epoch)
227
 
        #print("bin: %s" % binver)
228
227
 
229
228
        split_section = section.split("/")
230
229
        if len(split_section) > 1:
333
332
 
334
333
        spphs = archive.getPublishedSources(source_name=cdt.source_name,
335
334
                                            exact_match=True,
336
 
                                            version=cdt.version)
 
335
                                            version=cdt.source_version)
337
336
        if not spphs:
338
337
            logging.error("No published sources were retrieved from the "
339
338
                          "Launchpad API.")
354
353
        if "(" in srcrec:
355
354
            srcver = srcrec.split("(")[1].rstrip(")")
356
355
        else:
357
 
            srcver = pkg.candidate.version
 
356
            srcver = pkg.candidate.source_version
358
357
        base_uri = deb_uri.rpartition("/")[0]
359
358
        return base_uri + "/%s_%s.changelog" % (srcpkg, srcver)
360
359
 
438
437
            return
439
438
        # fixup epoch handling version
440
439
        srcpkg = self[name].candidate.source_name
441
 
        srcver_epoch = self[name].candidate.version.replace(':', '%3A')
 
440
        srcver_epoch = self[name].candidate.source_version.replace(':', '%3A')
442
441
        try:
443
442
            changelog = self._get_changelog_or_news(name, "changelog")
444
443
            if len(changelog) == 0: