Merge lp:~dpb/ubuntu-manpage-repository/fix-search-order into lp:ubuntu-manpage-repository

Proposed by David Britton
Status: Merged
Approved by: Joshua Powers
Approved revision: 235
Merged at revision: 219
Proposed branch: lp:~dpb/ubuntu-manpage-repository/fix-search-order
Merge into: lp:ubuntu-manpage-repository
Diff against target: 64 lines (+8/-11)
3 files modified
README.md (+0/-3)
cgi-bin/search.py (+7/-7)
www/functions.js (+1/-1)
To merge this branch: bzr merge lp:~dpb/ubuntu-manpage-repository/fix-search-order
Reviewer Review Type Date Requested Status
Joshua Powers (community) Approve
Review via email: mp+346848@code.launchpad.net

Commit message

Fix distro search order now that we have wrapped around the alphabet.

Description of the change

Testing instructions.

Download bionic and xenial sources, and try this link:

http://<ip>/manpages/en/man1/man.1.html

You will get pointed to Xenial, with the change from this branch, you should get bionic.

I have something set up to test if you would like to see the bug and reproduction. It needs access to the canonical VPN to validate:

http://10.247.8.11:8080/manpages/en/man1/man.1.html

You can switch the code back and forth like this:

ssh ambipom
lxc exec manpages bash
cd /srv/manpages.ubuntu.com

# old code:
bzr switch lp:ubuntu-manpage-repository

# new code:
bzr switch lp:~davidpbritton/ubuntu-manpage-repository/fix-search-order

# After switching:
bzr resolved --take-this bin/config

And then, you can try the link. Also, you'll notice that a general search for 'man' has the man page table in the right order.

To post a comment you must log in.
234. By David Britton

merge up along trunk

Revision history for this message
Joshua Powers (powersj) wrote :

2 questions below

Revision history for this message
David Britton (dpb) :
235. By David Britton

fix per powersj

Revision history for this message
Joshua Powers (powersj) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.md'
2--- README.md 2018-05-24 01:13:45 +0000
3+++ README.md 2018-05-24 20:36:46 +0000
4@@ -47,7 +47,6 @@
5 # Also, do the actually conversion from debs into manpages
6 make deps setup-and-mirror manpage-repo
7
8-
9 You can then reach the page at:
10
11 * http://<ip>:8080/index_real.html
12@@ -72,5 +71,3 @@
13 * search.py really needs someone to make functions and simplify it.
14 * switch container setup instructions to use 'manpages' user account
15 instead of root as they do now
16-
17-
18
19=== modified file 'cgi-bin/search.py'
20--- cgi-bin/search.py 2018-05-23 17:53:08 +0000
21+++ cgi-bin/search.py 2018-05-24 20:36:46 +0000
22@@ -26,6 +26,7 @@
23 # License can be found in /usr/share/common-licenses/GPL-3
24 ###############################################################################
25
26+from collections import OrderedDict
27 import cgi
28 import glob
29 import os
30@@ -112,15 +113,14 @@
31 else:
32 lr = "en"
33
34-versions = dict(
35- precise="12.04 LTS",
36- trusty="14.04 LTS",
37- xenial="16.04 LTS",
38- artful="17.10",
39- bionic="18.04 LTS")
40+versions = OrderedDict()
41+versions["precise"] = "12.04 LTS"
42+versions["trusty"] = "14.04 LTS"
43+versions["xenial"] = "16.04 LTS"
44+versions["artful"] = "17.10"
45+versions["bionic"] = "18.04 LTS"
46
47 distros = versions.keys()
48-distros.sort()
49 title_html += ("<br><table border=2 cellpadding=5 cellspacing=0><tr>"
50 "<td><table cellspacing=0 cellpadding=5><tr>")
51 for d in distros:
52
53=== modified file 'www/functions.js'
54--- www/functions.js 2018-01-29 14:27:29 +0000
55+++ www/functions.js 2018-05-24 20:36:46 +0000
56@@ -59,7 +59,7 @@
57
58 function distroAndSection() {
59 var parts = location.href.split("/");
60- if (parts.length < 5) {
61+ if (parts.length < 6) {
62 return;
63 }
64 var distro = parts[4];

Subscribers

People subscribed via source and target branches