Merge lp:~cjwatson/launchpad/fix-dsp-index-version-link into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18206
Proposed branch: lp:~cjwatson/launchpad/fix-dsp-index-version-link
Merge into: lp:launchpad
Diff against target: 30 lines (+8/-1)
2 files modified
lib/lp/registry/templates/distributionsourcepackage-index.pt (+1/-1)
lib/lp/soyuz/stories/distribution/xx-distribution-packages.txt (+7/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/fix-dsp-index-version-link
Reviewer Review Type Date Requested Status
William Grant (community) code Approve
Review via email: mp+307378@code.launchpad.net

Commit message

Link to package versions on DSP:+index using fmt:url rather than just a relative link to the version, to avoid problems with epochs.

Description of the change

Link to package versions on DSP:+index using fmt:url rather than just a relative link to the version, to avoid problems with epochs.

We arguably ought to actually URL-encode the path rather than relying on browsers stopping parsing the scheme at "/", but this is a much less invasive change for now and fixes the problem at hand; it brings the links on DSP:+index into line with those on DSP:+publishinghistory.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/templates/distributionsourcepackage-index.pt'
2--- lib/lp/registry/templates/distributionsourcepackage-index.pt 2015-09-07 12:42:33 +0000
3+++ lib/lp/registry/templates/distributionsourcepackage-index.pt 2016-10-01 13:32:34 +0000
4@@ -146,7 +146,7 @@
5 <a class="expander"
6 tal:attributes="id string:pub${pub/id}-expander;
7 href string:${pub/archive/fmt:url}/+sourcepub/${pub/id}/+listing-archive-extra"></a>
8- <a tal:attributes="href row/version">
9+ <a tal:attributes="href pub/meta_distributionsourcepackagerelease/fmt:url">
10 <img src="/@@/package-source" />
11 <tal:version content="row/version"/>
12 </a>
13
14=== modified file 'lib/lp/soyuz/stories/distribution/xx-distribution-packages.txt'
15--- lib/lp/soyuz/stories/distribution/xx-distribution-packages.txt 2016-05-17 09:48:54 +0000
16+++ lib/lp/soyuz/stories/distribution/xx-distribution-packages.txt 2016-10-01 13:32:34 +0000
17@@ -217,6 +217,13 @@
18 iceweasel-1.0.dsc (123 bytes)
19 mozilla-firefox_0.9_i386.deb (3 bytes)
20
21+The version itself links to the corresponding distro package release. (Our
22+search includes a leading space in order to exclude the "Latest upload:"
23+link.)
24+
25+ >>> print user_browser.getLink(" 1.0").attrs['href']
26+ /ubuntu/+source/iceweasel/1.0
27+
28 There's also a section on the page that gives some package information:
29
30 >>> print extract_text(find_tag_by_id(user_browser.contents, 'current'))