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

Proposed by Colin Watson
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 Approve
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.
Revision history for this message
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
1=== modified file 'UpdateManager/Core/MyCache.py'
2--- UpdateManager/Core/MyCache.py 2018-10-01 15:56:40 +0000
3+++ UpdateManager/Core/MyCache.py 2019-03-26 12:58:13 +0000
4@@ -221,10 +221,9 @@
5 # use the section of the candidate as a starting point
6 section = pkg._pcache._depcache.get_candidate_ver(pkg._pkg).section
7
8- # get the source version, start with the binaries version
9- srcver_epoch = pkg.candidate.version
10+ # get the source version
11+ srcver_epoch = pkg.candidate.source_version
12 srcver = self._strip_epoch(srcver_epoch)
13- #print("bin: %s" % binver)
14
15 split_section = section.split("/")
16 if len(split_section) > 1:
17@@ -333,7 +332,7 @@
18
19 spphs = archive.getPublishedSources(source_name=cdt.source_name,
20 exact_match=True,
21- version=cdt.version)
22+ version=cdt.source_version)
23 if not spphs:
24 logging.error("No published sources were retrieved from the "
25 "Launchpad API.")
26@@ -354,7 +353,7 @@
27 if "(" in srcrec:
28 srcver = srcrec.split("(")[1].rstrip(")")
29 else:
30- srcver = pkg.candidate.version
31+ srcver = pkg.candidate.source_version
32 base_uri = deb_uri.rpartition("/")[0]
33 return base_uri + "/%s_%s.changelog" % (srcpkg, srcver)
34
35@@ -438,7 +437,7 @@
36 return
37 # fixup epoch handling version
38 srcpkg = self[name].candidate.source_name
39- srcver_epoch = self[name].candidate.version.replace(':', '%3A')
40+ srcver_epoch = self[name].candidate.source_version.replace(':', '%3A')
41 try:
42 changelog = self._get_changelog_or_news(name, "changelog")
43 if len(changelog) == 0:
44
45=== modified file 'debian/changelog'
46--- debian/changelog 2019-02-10 18:24:18 +0000
47+++ debian/changelog 2019-03-26 12:58:13 +0000
48@@ -1,3 +1,10 @@
49+update-manager (1:19.04.4) UNRELEASED; urgency=medium
50+
51+ * Use the source version to generate changelog URIs, not the binary
52+ version (LP: #655917).
53+
54+ -- Colin Watson <cjwatson@ubuntu.com> Tue, 26 Mar 2019 12:52:51 +0000
55+
56 update-manager (1:19.04.3) disco; urgency=medium
57
58 * 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: