Merge lp:~dpb/ubuntu-manpage-repository/highlight-current-series into lp:ubuntu-manpage-repository

Proposed by David Britton
Status: Merged
Merged at revision: 222
Proposed branch: lp:~dpb/ubuntu-manpage-repository/highlight-current-series
Merge into: lp:ubuntu-manpage-repository
Diff against target: 779 lines (+277/-125)
13 files modified
Makefile (+18/-16)
README.md (+17/-66)
bin/fetch-man-pages.sh (+6/-5)
bin/make-manpage-repo.sh (+38/-19)
bin/make-sitemaps.sh (+1/-1)
examples/config (+9/-3)
tools/create-microsite-container.sh (+42/-0)
tools/setup-archive-fixture-in-server.sh (+30/-0)
tools/setup-in-server.sh (+0/-8)
tools/update-fixtures.sh (+68/-0)
tools/update-microsite-container.sh (+35/-0)
www/assets/light/css/styles.css (+6/-0)
www/functions.js (+7/-7)
To merge this branch: bzr merge lp:~dpb/ubuntu-manpage-repository/highlight-current-series
Reviewer Review Type Date Requested Status
Joshua Powers (community) Approve
Review via email: mp+347488@code.launchpad.net

Commit message

new additions:

1) Easy microsite create with makefile target using LXD and a checked-in mini archive.

2) fixed width fonts

3) highlight current series in bold

4) cache invalidate generated manpages once per month (on average)

5) limit generated manpage to 100 columns.

To post a comment you must log in.
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 'Makefile'
2--- Makefile 2018-06-03 17:10:52 +0000
3+++ Makefile 2018-06-05 23:57:15 +0000
4@@ -5,21 +5,23 @@
5 deps:
6 sudo apt -y install w3m shellcheck flake8 < /dev/null
7
8-# Note, this is destructive, you could have just wasted hours of
9-# manpage building by running it. Try not to make this the default
10-# action or make it a dependency of another operation.
11 clean:
12 rm -rf www/manpages www/manpages.gz
13-
14-manpage-repo:
15- @echo "The first time this runs, it could take many hours"
16- @sleep 2
17- (cd bin && ./make-manpage-repo.sh)
18- @echo "If running locally: file://$(pwd)/www"
19- @echo "If running in container: http://<IP_ADDR>:8080/"
20-
21-setup-and-mirror:
22- @echo "This will be downloading >8GB of data, it could take a while..."
23- @sleep 2
24- ./tools/setup-in-server.sh
25- apt-mirror
26+ [ -L config ] && rm config
27+
28+config:
29+ ln -s examples/config config
30+
31+manpage-repo: config
32+ bin/make-manpage-repo.sh
33+
34+create-microsite-container:
35+ tools/create-microsite-container.sh
36+
37+update-microsite-container:
38+ tools/update-microsite-container.sh
39+
40+setup-microsite-in-server: config
41+ tools/setup-archive-fixture-in-server.sh
42+ tools/setup-in-server.sh
43+
44
45=== modified file 'README.md'
46--- README.md 2018-05-24 20:36:29 +0000
47+++ README.md 2018-06-05 23:57:15 +0000
48@@ -1,73 +1,24 @@
49-See: https://launchpad.net/ubuntu-manpage-repository for developing
50-information.
51-
52-# Hacking locally, without setting up a micro site
53-
54-Make changes, then...
55-
56- make deps
57- cd bin; ./make-manpage-repo.sh
58-
59-And then, wait, you can typically kill this after a couple minutes as
60-you will have some data available then. After that, you can check
61-things out by pulling up:
62-
63- * file:///home/<user>/<path_to_source>/www/ in chrome...
64-
65-Note, for most bugs, you do not need to wait for everything to
66-download/create. Instead, you can just generate a few pages and check
67-what happened there.
68-
69-To start over:
70-
71- make clean
72+See also: https://launchpad.net/ubuntu-manpage-repository
73
74 # Setting up a micro site for dev/test in a container
75
76-To get the search form to work and debug more complex issues, you need
77-to set up a real microsite. The quickest way I have is to create a
78-container, checkout the code there, and setup. These instructions
79-should help. Once in the container, this should all be run as root.
80-
81-After this has been done one time, updates should be fast. Some sample
82-times:
83-
84- # create container / install bzr
85- lxc launch ubuntu:xenial manpages-test
86- lxc exec manpages-test bash
87- apt update
88- apt install bzr make
89-
90- # Checkout source (Remember, you can checkout your branch too)
91- cd /srv
92- bzr checkout lp:ubuntu-manpage-repository manpages.ubuntu.com
93- cd manpages.ubuntu.com
94-
95- # Setup the container, and start the mirror process (>8GB d/l ahead)
96- # Also, do the actually conversion from debs into manpages
97- make deps setup-and-mirror manpage-repo
98-
99-You can then reach the page at:
100-
101- * http://<ip>:8080/index_real.html
102- * http://<ip>:8080/cgi-bin/search.py?q=aalib-config (one of the first pages that
103- should be downloaded)
104-
105-# Dev notes
106-
107- * Don't erase the apt-mirror (/srv/manpages.ubuntu.com/ubuntu/), it can
108- just be updated by the 'setup-and-mirror' make target each time.
109- * Manpage generation takes about 40m on my computer. It also doesn't
110- usually need to be repeated
111- * The config files limit the archive to bionic/main by default, just to
112- help speed up development, you can expand those as necessary.
113+To help ease the testing of this there is tooling in place to create a
114+small "microsite". This just puts out a Packages files with a small
115+set of packages for testing pursposes in a container. It also copies
116+the current branch (.bzr file and all) out to the container in the
117+/srv/manpages.ubuntu.com directory, making it super easy to test out
118+your changes.
119+
120+ make create-microsite-container
121+
122+You can also override the default container name
123+(default=**manpages-microsite**), if you want to deploy
124+two sites to compare, for instance:
125+
126+ MICROSITE_CONTAINER=name2 make create-microsite-container
127
128 # TODO
129
130- * remove creation of the needed symlink for the real dev site testing,
131- this requires modification of search.py
132- * create a series/branch for production since the configuration needs
133- to be modified for devel/production. Or solve in some other way.
134 * search.py really needs someone to make functions and simplify it.
135- * switch container setup instructions to use 'manpages' user account
136- instead of root as they do now
137+ * switch container setup script to use a 'manpages' user account
138+ instead of root as it does now
139
140=== modified file 'bin/fetch-man-pages.sh'
141--- bin/fetch-man-pages.sh 2018-06-03 18:27:44 +0000
142+++ bin/fetch-man-pages.sh 2018-06-05 23:57:15 +0000
143@@ -29,7 +29,7 @@
144 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
145
146 # shellcheck disable=SC1090
147-. "$DIR/config"
148+. "$DIR/../config"
149
150 TEMPDIR=$(mktemp -d -t manpages-fetch-XXXXXX)
151 trap 'rm -rf $TEMPDIR 2>/dev/null || true' EXIT HUP INT QUIT TERM
152@@ -60,7 +60,7 @@
153 if [ -z "$man" ]; then
154 echo "INFO: No manpages: [$DIST] [$PKG]"
155 # Touch the cache file so we don't look again until package updated
156- sha1sum "$DEB" | awk '{ print $1 }' >> "$DESTDIR/.cache/$NAME"
157+ sha1sum "$DEB" | awk '{ print $1 }' > "$DESTDIR/.cache/$NAME"
158 exit 0
159 fi
160
161@@ -81,7 +81,8 @@
162 manpage="$TEMPDIR/$i"
163 i=$(printf "%s" "$i" | sed -e "s/usr\/share.*\/man\///i" -e "s/\.gz$//")
164 #printf "%s\n" "INFO: Considering manpage [$i]"
165- if [ ! -s "$manpage" -o -z "$i" -a "$SYMLINK" = "0" ]; then
166+ # shellcheck disable=SC2166
167+ if [ ! -s "$manpage" -o -z "$i" ] && [ "$SYMLINK" = "0" ]; then
168 #printf "%s\n" "INFO: Skipping empty manpage [$manpage]"
169 continue
170 fi
171@@ -97,7 +98,7 @@
172 ln -f -s "$LN" "$out"
173 printf "INFO: Created symlink [%s]" "$out"
174 else
175- BODY=$(/usr/lib/w3m/cgi-bin/w3mman2html.cgi "local=$manpage" | grep -A 1000000 "^<b>" | sed -e '/<\/body>/,+100 d' -e 's:^<b>\(.*\)</b>$:</pre><h4><b>\1</b></h4><pre>:g' -e 's:<a href="file\:///[^?]*?\([^(]*\)(\([^)]*\))">:<a href="../man\2/\1.\2.html">:g')
176+ BODY=$(COLUMNS=100 /usr/lib/w3m/cgi-bin/w3mman2html.cgi "local=$manpage" | grep -A 1000000 "^<b>" | sed -e '/<\/body>/,+100 d' -e 's:^<b>\(.*\)</b>$:</pre><h4><b>\1</b></h4><pre>:g' -e 's:<a href="file\:///[^?]*?\([^(]*\)(\([^)]*\))">:<a href="../man\2/\1.\2.html">:g')
177 TITLE=$(printf "%s" "$BODY" | head -n2 | tail -n1 | sed "s/<[^>]\+>//g")
178 BIN_PKG=$(printf "%s" "$NAME_AND_VER" | sed s/_.*$//g)
179 PKG_LINK="https://launchpad.net/ubuntu/$DIST/+package/$BIN_PKG"
180@@ -121,7 +122,7 @@
181
182 # After extracting all manpages, cache the sha1sum, so we don't
183 # repeat the downloads
184-sha1sum "$DEB" | awk '{ print $1 }' >> "$DESTDIR/.cache/$NAME"
185+sha1sum "$DEB" | awk '{ print $1 }' > "$DESTDIR/.cache/$NAME"
186
187 # In the case of freakish package permissions, fix them on rm failure.
188 rm -rf "$TEMPDIR" 2>/dev/null || ( chmod -R 700 "$TEMPDIR" && rm -rf "$TEMPDIR" ) || true
189
190=== modified file 'bin/make-manpage-repo.sh'
191--- bin/make-manpage-repo.sh 2018-06-03 17:15:58 +0000
192+++ bin/make-manpage-repo.sh 2018-06-05 23:57:15 +0000
193@@ -1,8 +1,6 @@
194 #!/bin/bash -e
195
196 ###############################################################################
197-# This is the Ubuntu manpage repository generator and interface.
198-#
199 # Copyright (C) 2008 Canonical Ltd.
200 #
201 # This code was originally written by Dustin Kirkland <kirkland@ubuntu.com>,
202@@ -27,8 +25,11 @@
203
204 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
205
206+# keeps shellcheck happy.
207+ARCH=""
208+
209 # shellcheck disable=SC1090
210-. "$DIR/config"
211+. "$DIR/../config"
212
213 # Establish some locking, to keep multiple updates from running
214 mkdir -p "$PUBLIC_HTML_DIR/manpages"
215@@ -47,10 +48,11 @@
216 get_packages_url() {
217 dist=$1
218 repo=$2
219- if [ -e "$DEBDIR/dists/$dist/$repo/binary-$ARCH/Packages.gz" ]; then
220- echo "file://$DEBDIR/dists/$dist/$repo/binary-$ARCH/Packages.gz"
221+ arch=$3
222+ if [ -e "$DEBDIR/dists/$dist/$repo/binary-$arch/Packages.gz" ]; then
223+ echo "file://$DEBDIR/dists/$dist/$repo/binary-$arch/Packages.gz"
224 else
225- echo "$ARCHIVE/dists/$dist/$repo/binary-$ARCH/Packages.gz"
226+ echo "$ARCHIVE/dists/$dist/$repo/binary-$arch/Packages.gz"
227 fi
228 }
229
230@@ -73,10 +75,25 @@
231 sum="$2"
232 name=$(basename "$deb" | awk -F_ '{print $1}')
233 existing_sum=$(cat "$PUBLIC_HTML_DIR/manpages/$dist/.cache/$name" 2>/dev/null)
234+
235+ # Take the first two digits of the existing_sum modulo 28 to
236+ # compare to the current day of month.
237+ #
238+ # Reasoning: this will invalidate the cache for everything ~
239+ # once per month (days: 1-28)
240+ day_mod=$((0x$(echo "$existing_sum" | cut -b 1-2)%27 + 1))
241+ if [ "$day_mod" -eq "$(date +%d)" ]; then
242+ echo "INFO: date_mod match, regnerating: $deb ($day_mod)"
243+ return 0
244+ fi
245+
246+ # Of course, if the sum found in the packages file for this
247+ # package does not equal the sum I have on disk, regenerate.
248 if [ "$existing_sum" = "$sum" ]; then
249 echo "INFO: cksum skip: $deb"
250 return 1
251 else
252+ echo "INFO: cksum mismatch: $deb"
253 return 0
254 fi
255 }
256@@ -88,7 +105,7 @@
257 deburl=$(get_deb_url "$deb")
258 # FIXME: the || true needs to bubble up to a list of things wrong obviously.
259 # shellcheck disable=SC2015
260- is_pkg_cache_invalid "$deb" "$sum" && ./fetch-man-pages.sh "$dist" "$deburl" || true
261+ is_pkg_cache_invalid "$deb" "$sum" && "$DIR/fetch-man-pages.sh" "$dist" "$deburl" || true
262 }
263
264 link_en_locale() {
265@@ -122,18 +139,20 @@
266 mkdir -p "$PUBLIC_HTML_DIR/manpages/$dist/.cache" "$PUBLIC_HTML_DIR/manpages.gz/$dist" || true
267 link_en_locale "$dist"
268 for repo in $REPOS; do
269- file=$(get_packages_url "$dist" "$repo")
270- echo "INFO: Packages.gz: $file"
271- curl -s "$file" \
272- | gunzip -c \
273- | grep -E "(^Filename: |^SHA1: )" \
274- | awk '{print $2}' \
275- | sed 'N;s/\n/ /' \
276- | sort -u \
277- | while read -r deb sum; do
278- handle_deb "$dist" "$deb" "$sum"
279- done
280+ for arch in $ARCH; do
281+ file=$(get_packages_url "$dist" "$repo" "$arch")
282+ echo "INFO: Packages.gz: $file"
283+ curl -s "$file" \
284+ | gunzip -c \
285+ | grep -E "(^Filename: |^SHA1: )" \
286+ | awk '{print $2}' \
287+ | sed 'N;s/\n/ /' \
288+ | sort -u \
289+ | while read -r deb sum; do
290+ handle_deb "$dist" "$deb" "$sum"
291+ done
292+ done
293 done
294 done
295
296-./make-sitemaps.sh
297+"$DIR/make-sitemaps.sh"
298
299=== modified file 'bin/make-sitemaps.sh'
300--- bin/make-sitemaps.sh 2018-06-03 17:15:58 +0000
301+++ bin/make-sitemaps.sh 2018-06-05 23:57:15 +0000
302@@ -30,7 +30,7 @@
303 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
304
305 # shellcheck disable=SC1090
306-. "$DIR/config"
307+. "$DIR/../config"
308
309 printf "%s\n" "INFO: Making sitemaps"
310
311
312=== renamed file 'bin/config' => 'examples/config'
313--- bin/config 2018-05-23 19:48:06 +0000
314+++ examples/config 2018-06-05 23:57:15 +0000
315@@ -1,5 +1,9 @@
316
317 # Customize this file and rename it to 'config'
318+# It should be in the root of the directory structure, like
319+# - bin/
320+# - www/
321+# - config
322
323 # What archive are you wanting to pull Packages.gz and .deb files from?
324 ARCHIVE="http://archive.ubuntu.com/ubuntu"
325@@ -9,13 +13,15 @@
326
327 # Point this at the location where you want the manpages
328 # and manpages.gz directories generated.
329-PUBLIC_HTML_DIR="$(pwd)/../www"
330+PUBLIC_HTML_DIR="/srv/manpages.ubuntu.com/www"
331
332 # For generating the sitemap.xml, everything else in the scripts
333 # uses relative links
334 SITE="http://manpages.ubuntu.com"
335
336 # These form a combinatorial download matrix
337-DISTROS="bionic"
338-REPOS="main"
339+DISTROS="bionic artful xenial trusty precise"
340+REPOS="main restricted universe multiverse"
341+
342+# For now, stick to a single arch
343 ARCH="amd64"
344
345=== added file 'tools/create-microsite-container.sh'
346--- tools/create-microsite-container.sh 1970-01-01 00:00:00 +0000
347+++ tools/create-microsite-container.sh 2018-06-05 23:57:15 +0000
348@@ -0,0 +1,42 @@
349+#!/bin/bash -e
350+#
351+# Goal: create a small microsite in a container from this branch
352+#
353+# Notes:
354+#
355+# - A new container will be created each time.
356+# - This script should be run as root
357+# - Your code will be copied into the microsite
358+
359+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
360+NAME=${MICROSITE_CONTAINER:-manpages-microsite}
361+SITE_PATH=/srv/manpages.ubuntu.com
362+
363+if ! lxc info "$NAME" 2>/dev/null; then
364+ lxc launch ubuntu:xenial "$NAME"
365+ sleep 5
366+ lxc exec "$NAME" -- apt update
367+else
368+ echo "-------------------------------------------"
369+ echo "Found existing container: $NAME"
370+ echo "Hit [CTRL]-c to avoid wiping out $NAME:$SITE_PATH"
371+ read -p "Press enter to continue"
372+ echo "-------------------------------------------"
373+fi
374+
375+lxc exec "$NAME" -- apt install -y apache2 bzr make < /dev/null
376+lxc exec "$NAME" -- rm -rf "$SITE_PATH"
377+lxc exec "$NAME" -- mkdir -p "$SITE_PATH"
378+tar cf - "$DIR/../" | lxc exec "$NAME" -- tar xvf - -C "$SITE_PATH"
379+lxc exec "$NAME" -- sh -c "cd $SITE_PATH; make deps setup-microsite-in-server manpage-repo"
380+
381+echo "--------"
382+echo "Summary:"
383+echo "--------"
384+echo ""
385+lxc list "$NAME"
386+
387+IP=$(lxc info "$NAME" |grep eth0: |grep -v inet6 | awk '{ print $3 }')
388+echo ""
389+echo "Site URL: http://$IP:8080"
390+echo " * Try searching for 'ac'"
391
392=== added directory 'tools/fixtures'
393=== added directory 'tools/fixtures/mirror'
394=== added directory 'tools/fixtures/mirror/dists'
395=== added directory 'tools/fixtures/mirror/dists/artful'
396=== added directory 'tools/fixtures/mirror/dists/artful/main'
397=== added directory 'tools/fixtures/mirror/dists/artful/main/binary-amd64'
398=== added file 'tools/fixtures/mirror/dists/artful/main/binary-amd64/Packages.gz'
399Binary files tools/fixtures/mirror/dists/artful/main/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/artful/main/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
400=== added directory 'tools/fixtures/mirror/dists/artful/main/binary-s390x'
401=== added file 'tools/fixtures/mirror/dists/artful/main/binary-s390x/Packages.gz'
402Binary files tools/fixtures/mirror/dists/artful/main/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/artful/main/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
403=== added directory 'tools/fixtures/mirror/dists/artful/multiverse'
404=== added directory 'tools/fixtures/mirror/dists/artful/multiverse/binary-amd64'
405=== added file 'tools/fixtures/mirror/dists/artful/multiverse/binary-amd64/Packages.gz'
406Binary files tools/fixtures/mirror/dists/artful/multiverse/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/artful/multiverse/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
407=== added directory 'tools/fixtures/mirror/dists/artful/multiverse/binary-s390x'
408=== added file 'tools/fixtures/mirror/dists/artful/multiverse/binary-s390x/Packages.gz'
409Binary files tools/fixtures/mirror/dists/artful/multiverse/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/artful/multiverse/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
410=== added directory 'tools/fixtures/mirror/dists/artful/restricted'
411=== added directory 'tools/fixtures/mirror/dists/artful/restricted/binary-amd64'
412=== added file 'tools/fixtures/mirror/dists/artful/restricted/binary-amd64/Packages.gz'
413Binary files tools/fixtures/mirror/dists/artful/restricted/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/artful/restricted/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
414=== added directory 'tools/fixtures/mirror/dists/artful/restricted/binary-s390x'
415=== added file 'tools/fixtures/mirror/dists/artful/restricted/binary-s390x/Packages.gz'
416Binary files tools/fixtures/mirror/dists/artful/restricted/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/artful/restricted/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
417=== added directory 'tools/fixtures/mirror/dists/artful/universe'
418=== added directory 'tools/fixtures/mirror/dists/artful/universe/binary-amd64'
419=== added file 'tools/fixtures/mirror/dists/artful/universe/binary-amd64/Packages.gz'
420Binary files tools/fixtures/mirror/dists/artful/universe/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/artful/universe/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
421=== added directory 'tools/fixtures/mirror/dists/artful/universe/binary-s390x'
422=== added file 'tools/fixtures/mirror/dists/artful/universe/binary-s390x/Packages.gz'
423Binary files tools/fixtures/mirror/dists/artful/universe/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/artful/universe/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
424=== added directory 'tools/fixtures/mirror/dists/bionic'
425=== added directory 'tools/fixtures/mirror/dists/bionic/main'
426=== added directory 'tools/fixtures/mirror/dists/bionic/main/binary-amd64'
427=== added file 'tools/fixtures/mirror/dists/bionic/main/binary-amd64/Packages.gz'
428Binary files tools/fixtures/mirror/dists/bionic/main/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/bionic/main/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
429=== added directory 'tools/fixtures/mirror/dists/bionic/main/binary-s390x'
430=== added file 'tools/fixtures/mirror/dists/bionic/main/binary-s390x/Packages.gz'
431Binary files tools/fixtures/mirror/dists/bionic/main/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/bionic/main/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
432=== added directory 'tools/fixtures/mirror/dists/bionic/multiverse'
433=== added directory 'tools/fixtures/mirror/dists/bionic/multiverse/binary-amd64'
434=== added file 'tools/fixtures/mirror/dists/bionic/multiverse/binary-amd64/Packages.gz'
435Binary files tools/fixtures/mirror/dists/bionic/multiverse/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/bionic/multiverse/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
436=== added directory 'tools/fixtures/mirror/dists/bionic/multiverse/binary-s390x'
437=== added file 'tools/fixtures/mirror/dists/bionic/multiverse/binary-s390x/Packages.gz'
438Binary files tools/fixtures/mirror/dists/bionic/multiverse/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/bionic/multiverse/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
439=== added directory 'tools/fixtures/mirror/dists/bionic/restricted'
440=== added directory 'tools/fixtures/mirror/dists/bionic/restricted/binary-amd64'
441=== added file 'tools/fixtures/mirror/dists/bionic/restricted/binary-amd64/Packages.gz'
442Binary files tools/fixtures/mirror/dists/bionic/restricted/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/bionic/restricted/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
443=== added directory 'tools/fixtures/mirror/dists/bionic/restricted/binary-s390x'
444=== added file 'tools/fixtures/mirror/dists/bionic/restricted/binary-s390x/Packages.gz'
445Binary files tools/fixtures/mirror/dists/bionic/restricted/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/bionic/restricted/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
446=== added directory 'tools/fixtures/mirror/dists/bionic/universe'
447=== added directory 'tools/fixtures/mirror/dists/bionic/universe/binary-amd64'
448=== added file 'tools/fixtures/mirror/dists/bionic/universe/binary-amd64/Packages.gz'
449Binary files tools/fixtures/mirror/dists/bionic/universe/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/bionic/universe/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
450=== added directory 'tools/fixtures/mirror/dists/bionic/universe/binary-s390x'
451=== added file 'tools/fixtures/mirror/dists/bionic/universe/binary-s390x/Packages.gz'
452Binary files tools/fixtures/mirror/dists/bionic/universe/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/bionic/universe/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
453=== added directory 'tools/fixtures/mirror/dists/precise'
454=== added directory 'tools/fixtures/mirror/dists/precise/main'
455=== added directory 'tools/fixtures/mirror/dists/precise/main/binary-amd64'
456=== added file 'tools/fixtures/mirror/dists/precise/main/binary-amd64/Packages.gz'
457Binary files tools/fixtures/mirror/dists/precise/main/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/precise/main/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
458=== added directory 'tools/fixtures/mirror/dists/precise/main/binary-s390x'
459=== added file 'tools/fixtures/mirror/dists/precise/main/binary-s390x/Packages.gz'
460Binary files tools/fixtures/mirror/dists/precise/main/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/precise/main/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
461=== added directory 'tools/fixtures/mirror/dists/precise/multiverse'
462=== added directory 'tools/fixtures/mirror/dists/precise/multiverse/binary-amd64'
463=== added file 'tools/fixtures/mirror/dists/precise/multiverse/binary-amd64/Packages.gz'
464Binary files tools/fixtures/mirror/dists/precise/multiverse/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/precise/multiverse/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
465=== added directory 'tools/fixtures/mirror/dists/precise/multiverse/binary-s390x'
466=== added file 'tools/fixtures/mirror/dists/precise/multiverse/binary-s390x/Packages.gz'
467Binary files tools/fixtures/mirror/dists/precise/multiverse/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/precise/multiverse/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
468=== added directory 'tools/fixtures/mirror/dists/precise/restricted'
469=== added directory 'tools/fixtures/mirror/dists/precise/restricted/binary-amd64'
470=== added file 'tools/fixtures/mirror/dists/precise/restricted/binary-amd64/Packages.gz'
471Binary files tools/fixtures/mirror/dists/precise/restricted/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/precise/restricted/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
472=== added directory 'tools/fixtures/mirror/dists/precise/restricted/binary-s390x'
473=== added file 'tools/fixtures/mirror/dists/precise/restricted/binary-s390x/Packages.gz'
474Binary files tools/fixtures/mirror/dists/precise/restricted/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/precise/restricted/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
475=== added directory 'tools/fixtures/mirror/dists/precise/universe'
476=== added directory 'tools/fixtures/mirror/dists/precise/universe/binary-amd64'
477=== added file 'tools/fixtures/mirror/dists/precise/universe/binary-amd64/Packages.gz'
478Binary files tools/fixtures/mirror/dists/precise/universe/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/precise/universe/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
479=== added directory 'tools/fixtures/mirror/dists/precise/universe/binary-s390x'
480=== added file 'tools/fixtures/mirror/dists/precise/universe/binary-s390x/Packages.gz'
481Binary files tools/fixtures/mirror/dists/precise/universe/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/precise/universe/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
482=== added directory 'tools/fixtures/mirror/dists/trusty'
483=== added directory 'tools/fixtures/mirror/dists/trusty/main'
484=== added directory 'tools/fixtures/mirror/dists/trusty/main/binary-amd64'
485=== added file 'tools/fixtures/mirror/dists/trusty/main/binary-amd64/Packages.gz'
486Binary files tools/fixtures/mirror/dists/trusty/main/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/trusty/main/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
487=== added directory 'tools/fixtures/mirror/dists/trusty/main/binary-s390x'
488=== added file 'tools/fixtures/mirror/dists/trusty/main/binary-s390x/Packages.gz'
489Binary files tools/fixtures/mirror/dists/trusty/main/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/trusty/main/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
490=== added directory 'tools/fixtures/mirror/dists/trusty/multiverse'
491=== added directory 'tools/fixtures/mirror/dists/trusty/multiverse/binary-amd64'
492=== added file 'tools/fixtures/mirror/dists/trusty/multiverse/binary-amd64/Packages.gz'
493Binary files tools/fixtures/mirror/dists/trusty/multiverse/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/trusty/multiverse/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
494=== added directory 'tools/fixtures/mirror/dists/trusty/multiverse/binary-s390x'
495=== added file 'tools/fixtures/mirror/dists/trusty/multiverse/binary-s390x/Packages.gz'
496Binary files tools/fixtures/mirror/dists/trusty/multiverse/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/trusty/multiverse/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
497=== added directory 'tools/fixtures/mirror/dists/trusty/restricted'
498=== added directory 'tools/fixtures/mirror/dists/trusty/restricted/binary-amd64'
499=== added file 'tools/fixtures/mirror/dists/trusty/restricted/binary-amd64/Packages.gz'
500Binary files tools/fixtures/mirror/dists/trusty/restricted/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/trusty/restricted/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
501=== added directory 'tools/fixtures/mirror/dists/trusty/restricted/binary-s390x'
502=== added file 'tools/fixtures/mirror/dists/trusty/restricted/binary-s390x/Packages.gz'
503Binary files tools/fixtures/mirror/dists/trusty/restricted/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/trusty/restricted/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
504=== added directory 'tools/fixtures/mirror/dists/trusty/universe'
505=== added directory 'tools/fixtures/mirror/dists/trusty/universe/binary-amd64'
506=== added file 'tools/fixtures/mirror/dists/trusty/universe/binary-amd64/Packages.gz'
507Binary files tools/fixtures/mirror/dists/trusty/universe/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/trusty/universe/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
508=== added directory 'tools/fixtures/mirror/dists/trusty/universe/binary-s390x'
509=== added file 'tools/fixtures/mirror/dists/trusty/universe/binary-s390x/Packages.gz'
510Binary files tools/fixtures/mirror/dists/trusty/universe/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/trusty/universe/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
511=== added directory 'tools/fixtures/mirror/dists/xenial'
512=== added directory 'tools/fixtures/mirror/dists/xenial/main'
513=== added directory 'tools/fixtures/mirror/dists/xenial/main/binary-amd64'
514=== added file 'tools/fixtures/mirror/dists/xenial/main/binary-amd64/Packages.gz'
515Binary files tools/fixtures/mirror/dists/xenial/main/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/xenial/main/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
516=== added directory 'tools/fixtures/mirror/dists/xenial/main/binary-s390x'
517=== added file 'tools/fixtures/mirror/dists/xenial/main/binary-s390x/Packages.gz'
518Binary files tools/fixtures/mirror/dists/xenial/main/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/xenial/main/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
519=== added directory 'tools/fixtures/mirror/dists/xenial/multiverse'
520=== added directory 'tools/fixtures/mirror/dists/xenial/multiverse/binary-amd64'
521=== added file 'tools/fixtures/mirror/dists/xenial/multiverse/binary-amd64/Packages.gz'
522Binary files tools/fixtures/mirror/dists/xenial/multiverse/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/xenial/multiverse/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
523=== added directory 'tools/fixtures/mirror/dists/xenial/multiverse/binary-s390x'
524=== added file 'tools/fixtures/mirror/dists/xenial/multiverse/binary-s390x/Packages.gz'
525Binary files tools/fixtures/mirror/dists/xenial/multiverse/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/xenial/multiverse/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
526=== added directory 'tools/fixtures/mirror/dists/xenial/restricted'
527=== added directory 'tools/fixtures/mirror/dists/xenial/restricted/binary-amd64'
528=== added file 'tools/fixtures/mirror/dists/xenial/restricted/binary-amd64/Packages.gz'
529Binary files tools/fixtures/mirror/dists/xenial/restricted/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/xenial/restricted/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
530=== added directory 'tools/fixtures/mirror/dists/xenial/restricted/binary-s390x'
531=== added file 'tools/fixtures/mirror/dists/xenial/restricted/binary-s390x/Packages.gz'
532Binary files tools/fixtures/mirror/dists/xenial/restricted/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/xenial/restricted/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
533=== added directory 'tools/fixtures/mirror/dists/xenial/universe'
534=== added directory 'tools/fixtures/mirror/dists/xenial/universe/binary-amd64'
535=== added file 'tools/fixtures/mirror/dists/xenial/universe/binary-amd64/Packages.gz'
536Binary files tools/fixtures/mirror/dists/xenial/universe/binary-amd64/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/xenial/universe/binary-amd64/Packages.gz 2018-06-05 23:57:15 +0000 differ
537=== added directory 'tools/fixtures/mirror/dists/xenial/universe/binary-s390x'
538=== added file 'tools/fixtures/mirror/dists/xenial/universe/binary-s390x/Packages.gz'
539Binary files tools/fixtures/mirror/dists/xenial/universe/binary-s390x/Packages.gz 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/dists/xenial/universe/binary-s390x/Packages.gz 2018-06-05 23:57:15 +0000 differ
540=== added directory 'tools/fixtures/mirror/pool'
541=== added directory 'tools/fixtures/mirror/pool/main'
542=== added directory 'tools/fixtures/mirror/pool/main/a'
543=== added directory 'tools/fixtures/mirror/pool/main/a/acct'
544=== added file 'tools/fixtures/mirror/pool/main/a/acct/acct_6.5.5-1ubuntu1_amd64.deb'
545Binary files tools/fixtures/mirror/pool/main/a/acct/acct_6.5.5-1ubuntu1_amd64.deb 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/pool/main/a/acct/acct_6.5.5-1ubuntu1_amd64.deb 2018-06-05 23:57:15 +0000 differ
546=== added file 'tools/fixtures/mirror/pool/main/a/acct/acct_6.5.5-1ubuntu5_amd64.deb'
547Binary files tools/fixtures/mirror/pool/main/a/acct/acct_6.5.5-1ubuntu5_amd64.deb 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/pool/main/a/acct/acct_6.5.5-1ubuntu5_amd64.deb 2018-06-05 23:57:15 +0000 differ
548=== added file 'tools/fixtures/mirror/pool/main/a/acct/acct_6.5.5-2.1ubuntu1_amd64.deb'
549Binary files tools/fixtures/mirror/pool/main/a/acct/acct_6.5.5-2.1ubuntu1_amd64.deb 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/pool/main/a/acct/acct_6.5.5-2.1ubuntu1_amd64.deb 2018-06-05 23:57:15 +0000 differ
550=== added file 'tools/fixtures/mirror/pool/main/a/acct/acct_6.5.5-2.1ubuntu1_s390x.deb'
551Binary files tools/fixtures/mirror/pool/main/a/acct/acct_6.5.5-2.1ubuntu1_s390x.deb 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/pool/main/a/acct/acct_6.5.5-2.1ubuntu1_s390x.deb 2018-06-05 23:57:15 +0000 differ
552=== added file 'tools/fixtures/mirror/pool/main/a/acct/acct_6.6.4-1_amd64.deb'
553Binary files tools/fixtures/mirror/pool/main/a/acct/acct_6.6.4-1_amd64.deb 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/pool/main/a/acct/acct_6.6.4-1_amd64.deb 2018-06-05 23:57:15 +0000 differ
554=== added file 'tools/fixtures/mirror/pool/main/a/acct/acct_6.6.4-1_s390x.deb'
555Binary files tools/fixtures/mirror/pool/main/a/acct/acct_6.6.4-1_s390x.deb 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/pool/main/a/acct/acct_6.6.4-1_s390x.deb 2018-06-05 23:57:15 +0000 differ
556=== added directory 'tools/fixtures/mirror/pool/main/s'
557=== added directory 'tools/fixtures/mirror/pool/main/s/s390-tools'
558=== added file 'tools/fixtures/mirror/pool/main/s/s390-tools/s390-tools_1.34.0-0ubuntu8_s390x.deb'
559Binary files tools/fixtures/mirror/pool/main/s/s390-tools/s390-tools_1.34.0-0ubuntu8_s390x.deb 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/pool/main/s/s390-tools/s390-tools_1.34.0-0ubuntu8_s390x.deb 2018-06-05 23:57:15 +0000 differ
560=== added file 'tools/fixtures/mirror/pool/main/s/s390-tools/s390-tools_1.39.0-0ubuntu4_s390x.deb'
561Binary files tools/fixtures/mirror/pool/main/s/s390-tools/s390-tools_1.39.0-0ubuntu4_s390x.deb 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/pool/main/s/s390-tools/s390-tools_1.39.0-0ubuntu4_s390x.deb 2018-06-05 23:57:15 +0000 differ
562=== added file 'tools/fixtures/mirror/pool/main/s/s390-tools/s390-tools_2.3.0-0ubuntu3_s390x.deb'
563Binary files tools/fixtures/mirror/pool/main/s/s390-tools/s390-tools_2.3.0-0ubuntu3_s390x.deb 1970-01-01 00:00:00 +0000 and tools/fixtures/mirror/pool/main/s/s390-tools/s390-tools_2.3.0-0ubuntu3_s390x.deb 2018-06-05 23:57:15 +0000 differ
564=== added file 'tools/setup-archive-fixture-in-server.sh'
565--- tools/setup-archive-fixture-in-server.sh 1970-01-01 00:00:00 +0000
566+++ tools/setup-archive-fixture-in-server.sh 2018-06-05 23:57:15 +0000
567@@ -0,0 +1,30 @@
568+#!/bin/bash -e
569+#
570+# Goal: idempotent script to setup this server with an archive
571+# built from the test fixture. That is, a reduced set of manpages
572+# to just test the functionality of the tool.
573+#
574+# Notes:
575+#
576+# - This script should be run as root
577+# - This script should be created/structured so that
578+# it's idempotent
579+
580+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
581+
582+# Defining arch avoids shellcheck lint
583+ARCH=""
584+
585+source "$DIR/../config"
586+mkdir -p "$DEBDIR"
587+
588+# do this to avoid having to rm -rf whatever was in the mirror before I
589+# start. This seems the safest to avoid mistakingly blowing away
590+# someones mirror if they run this script accidently. It would instead
591+# just blow away the packages.gz files, which are fast to re-download.
592+cd -- "$DIR/fixtures/mirror" && find . -type f -exec sh -c '
593+ for x do
594+ mkdir -p "$0/${x%/*}"
595+ mv "$x" "$0/$x"
596+ done
597+' "$DEBDIR" {} +
598
599=== modified file 'tools/setup-in-server.sh'
600--- tools/setup-in-server.sh 2018-05-23 19:48:06 +0000
601+++ tools/setup-in-server.sh 2018-06-05 23:57:15 +0000
602@@ -12,15 +12,7 @@
603
604 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
605
606-apt update
607-
608-# use apt-mirror to setup a "small" archive mirro for testing the local
609-# archive case, as this is how production is run.
610-apt install -y apache2 apt-mirror < /dev/null
611-
612-cp -v "$DIR/../examples/mirror.list" /etc/apt/mirror.list
613 cp -v "$DIR/../examples/manpages-site.conf" /etc/apache2/sites-available/
614-ln -sf /var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu/ ../ubuntu
615
616 a2ensite manpages-site
617 a2enmod cgi
618
619=== added file 'tools/update-fixtures.sh'
620--- tools/update-fixtures.sh 1970-01-01 00:00:00 +0000
621+++ tools/update-fixtures.sh 2018-06-05 23:57:15 +0000
622@@ -0,0 +1,68 @@
623+#!/bin/bash -e
624+#
625+#TODO: CLEANUP
626+# Goal: idempotent script to setup this server with an archive
627+# built from the test fixture. That is, a reduced set of manpages
628+# to just test the functionality of the tool.
629+#
630+# Notes:
631+#
632+# - This script should be run as root
633+# - This script should be created/structured so that
634+# it's idempotent
635+
636+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
637+MIRROR="$DIR/fixtures/mirror"
638+PORTS="http://ports.ubuntu.com"
639+
640+# Keeps shellcheck happy
641+ARCH=""
642+source "$DIR/../config"
643+
644+# - multi-arch (s390-tools) - TODO: this makes a lot of manpages, maybe
645+# slim down?
646+# - something in main (acct)
647+PACKAGES="powerpc-ibm-utils acct s390-tools"
648+
649+# Download packages for all combinations. Note, some packages are not
650+# in all pockets, so don't fail on download errors.
651+for distro in $DISTROS; do
652+ for repo in $REPOS; do
653+ for arch in $ARCH; do
654+
655+ path="dists/$distro/$repo/binary-$arch"
656+ packagesgz="$path/Packages.gz"
657+ mkdir -p "$MIRROR/$path"
658+ if [ "$arch" == "amd64" ]; then
659+ site="$ARCHIVE"
660+ else
661+ site="$PORTS"
662+ fi
663+ echo "$site/$packagesgz"
664+ curl -s "$site/$packagesgz" -o "$MIRROR/$packagesgz"
665+
666+ for package in $PACKAGES; do
667+ filename=$(gunzip -c "$MIRROR/$packagesgz" \
668+ | egrep "(^Filename: |^Package: )" \
669+ | sed 'N;s/\n/ /' \
670+ | grep "Package: $package " \
671+ | awk '{ print $4 }')
672+ if [ -n "$filename" ]; then
673+ echo " - [$package]: $site/$filename"
674+ curl -fs "$site/$filename" \
675+ -o "$MIRROR/$path/$filename" \
676+ --create-dirs
677+ fi
678+ done
679+ (cd "$MIRROR/$path"; dpkg-scanpackages . | gzip -cn > Packages.gz)
680+ (cd -- "$MIRROR/$path" &&
681+ find . -type f -name '*.deb' -exec sh -c '
682+ for x do
683+ mkdir -p "$0/${x%/*}"
684+ mv "$x" "$0/$x"
685+ done
686+ ' "$MIRROR" {} +)
687+ rm -rf "$MIRROR/$path/pool"
688+ done
689+ done
690+done
691
692=== added file 'tools/update-microsite-container.sh'
693--- tools/update-microsite-container.sh 1970-01-01 00:00:00 +0000
694+++ tools/update-microsite-container.sh 2018-06-05 23:57:15 +0000
695@@ -0,0 +1,35 @@
696+#!/bin/bash -e
697+#
698+# Goal: create a small microsite in a container from this branch
699+#
700+# Notes:
701+#
702+# - A new container will be created each time.
703+# - This script should be run as root
704+# - Your code will be copied into the microsite
705+
706+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
707+NAME=${MICROSITE_CONTAINER:-manpages-microsite}
708+SITE_PATH=/srv/manpages.ubuntu.com
709+
710+if ! lxc info "$NAME" 2>/dev/null; then
711+ echo "-------------------------------------------"
712+ echo "Error: Existing container not found: $NAME"
713+ echo "Run 'make microsite-container' first"
714+ echo "-------------------------------------------"
715+ exit 1
716+fi
717+
718+tar cf - "$DIR/../" | lxc exec "$NAME" -- tar xvf - -C "$SITE_PATH"
719+lxc exec "$NAME" -- sh -c "cd $SITE_PATH; make deps manpage-repo"
720+
721+echo "--------"
722+echo "Summary:"
723+echo "--------"
724+echo ""
725+lxc list "$NAME"
726+
727+IP=$(lxc info "$NAME" |grep eth0: |grep -v inet6 | awk '{ print $3 }')
728+echo ""
729+echo "Site URL: http://$IP:8080"
730+echo " * Try searching for 'ac'"
731
732=== modified file 'www/assets/light/css/styles.css'
733--- www/assets/light/css/styles.css 2012-12-28 19:54:23 +0000
734+++ www/assets/light/css/styles.css 2018-06-05 23:57:15 +0000
735@@ -7,6 +7,9 @@
736 margin: 0px;
737 padding: 0px;
738 }
739+pre {
740+ font-family: "Ubuntu Mono", "Andale Mono", "DejaVu Sans Mono", monospace;
741+}
742 #container {
743 background: #f7f6f5;
744 margin: 0px auto 20px;
745@@ -260,6 +263,9 @@
746 #subheader ul li a:hover {
747 color: #772953;
748 }
749+#subheader ul li.current {
750+ font-weight: bold;
751+}
752 #subheader ul li a, #subheader ul li span, #subheader ul li input {
753 padding: 12px 8px 0;
754 display: block;
755
756=== modified file 'www/functions.js'
757--- www/functions.js 2018-05-24 20:05:50 +0000
758+++ www/functions.js 2018-06-05 23:57:15 +0000
759@@ -99,13 +99,13 @@
760 versions.push({"name":"artful", "number":"17.10"});
761 versions.push({"name":"bionic", "number":"18.04 LTS"});
762 for (var i=0; i<versions.length; i++) {
763- if (location.href.match("\.html$")) {
764- href = location.href;
765- href = href.replace(/\/manpages\/[^\/]*/, "/manpages/" + versions[i]["name"]);
766- document.write("<li class=\"active\" id=\"" + highlight(versions[i]["name"]) + "\"><a href=\"" + href + "\">" + versions[i]["number"] + "</a></li>");
767- } else {
768- document.write("<li id=\"" + highlight(versions[i]["name"]) + "\"><a href=\"/manpages/" + versions[i]["name"] + "\">" + versions[i]["number"] + "</a></li>");
769- }
770+ if (location.href.match("\.html$")) {
771+ href = location.href;
772+ href = href.replace(/\/manpages\/[^\/]*/, "/manpages/" + versions[i]["name"]);
773+ document.write("<li class=\"active " + highlight(versions[i]["name"]) + "\"><a href=\"" + href + "\">" + versions[i]["number"] + "</a></li>");
774+ } else {
775+ document.write("<li class=\"" + highlight(versions[i]["name"]) + "\"><a href=\"/manpages/" + versions[i]["name"] + "\">" + versions[i]["number"] + "</a></li>");
776+ }
777 }
778 document.write("<li><a href=\"javascript:printManpage()\"><img src=/img/printer.png></a></li>");
779 document.write("</ul>");

Subscribers

People subscribed via source and target branches