Merge lp:~cjwatson/update-manager/changelog-source-version into lp:update-manager

Proposed by Colin Watson on 2019-03-26
Status: Merged
Merged at revision: 2850
Proposed branch: lp:~cjwatson/update-manager/changelog-source-version
Merge into: lp:update-manager
Diff against target: 58 lines (+12/-6)
2 files modified
UpdateManager/Core/MyCache.py (+5/-6)
debian/changelog (+7/-0)
To merge this branch: bzr merge lp:~cjwatson/update-manager/changelog-source-version
Reviewer Review Type Date Requested Status
Brian Murray 2019-03-26 Approve on 2019-03-26
Review via email: mp+365103@code.launchpad.net

Commit message

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

Description of the change

I can't see any downsides to this, and it seems to work for me in some quick local testing. I suspect that when this code was originally written the source_version attribute didn't exist, but it has existed since 2010.

To post a comment you must log in.
Brian Murray (brian-murray) wrote :

I also did some local testing of this and did not encounter any issues. Thanks for making this change.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'UpdateManager/Core/MyCache.py'
--- UpdateManager/Core/MyCache.py 2018-10-01 15:56:40 +0000
+++ UpdateManager/Core/MyCache.py 2019-03-26 12:58:13 +0000
@@ -221,10 +221,9 @@
221 # use the section of the candidate as a starting point221 # use the section of the candidate as a starting point
222 section = pkg._pcache._depcache.get_candidate_ver(pkg._pkg).section222 section = pkg._pcache._depcache.get_candidate_ver(pkg._pkg).section
223223
224 # get the source version, start with the binaries version224 # get the source version
225 srcver_epoch = pkg.candidate.version225 srcver_epoch = pkg.candidate.source_version
226 srcver = self._strip_epoch(srcver_epoch)226 srcver = self._strip_epoch(srcver_epoch)
227 #print("bin: %s" % binver)
228227
229 split_section = section.split("/")228 split_section = section.split("/")
230 if len(split_section) > 1:229 if len(split_section) > 1:
@@ -333,7 +332,7 @@
333332
334 spphs = archive.getPublishedSources(source_name=cdt.source_name,333 spphs = archive.getPublishedSources(source_name=cdt.source_name,
335 exact_match=True,334 exact_match=True,
336 version=cdt.version)335 version=cdt.source_version)
337 if not spphs:336 if not spphs:
338 logging.error("No published sources were retrieved from the "337 logging.error("No published sources were retrieved from the "
339 "Launchpad API.")338 "Launchpad API.")
@@ -354,7 +353,7 @@
354 if "(" in srcrec:353 if "(" in srcrec:
355 srcver = srcrec.split("(")[1].rstrip(")")354 srcver = srcrec.split("(")[1].rstrip(")")
356 else:355 else:
357 srcver = pkg.candidate.version356 srcver = pkg.candidate.source_version
358 base_uri = deb_uri.rpartition("/")[0]357 base_uri = deb_uri.rpartition("/")[0]
359 return base_uri + "/%s_%s.changelog" % (srcpkg, srcver)358 return base_uri + "/%s_%s.changelog" % (srcpkg, srcver)
360359
@@ -438,7 +437,7 @@
438 return437 return
439 # fixup epoch handling version438 # fixup epoch handling version
440 srcpkg = self[name].candidate.source_name439 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 try:441 try:
443 changelog = self._get_changelog_or_news(name, "changelog")442 changelog = self._get_changelog_or_news(name, "changelog")
444 if len(changelog) == 0:443 if len(changelog) == 0:
445444
=== modified file 'debian/changelog'
--- debian/changelog 2019-02-10 18:24:18 +0000
+++ debian/changelog 2019-03-26 12:58:13 +0000
@@ -1,3 +1,10 @@
1update-manager (1:19.04.4) UNRELEASED; urgency=medium
2
3 * Use the source version to generate changelog URIs, not the binary
4 version (LP: #655917).
5
6 -- Colin Watson <cjwatson@ubuntu.com> Tue, 26 Mar 2019 12:52:51 +0000
7
1update-manager (1:19.04.3) disco; urgency=medium8update-manager (1:19.04.3) disco; urgency=medium
29
3 * Add gnome-shell as the first alternate for the polkit-1-auth-agent10 * Add gnome-shell as the first alternate for the polkit-1-auth-agent

Subscribers

People subscribed via source and target branches

to status/vote changes: