Merge lp:~paelzer/ubuntu-manpage-repository/ubuntu-manpage-repository-update-and-release into lp:ubuntu-manpage-repository

Proposed by Christian Ehrhardt 
Status: Merged
Merged at revision: 240
Proposed branch: lp:~paelzer/ubuntu-manpage-repository/ubuntu-manpage-repository-update-and-release
Merge into: lp:ubuntu-manpage-repository
Diff against target: 88 lines (+41/-25)
2 files modified
bin/make-manpage-repo.sh (+40/-19)
bin/manpages-modify-config (+1/-6)
To merge this branch: bzr merge lp:~paelzer/ubuntu-manpage-repository/ubuntu-manpage-repository-update-and-release
Reviewer Review Type Date Requested Status
Christian Ehrhardt  Approve
Paride Legovini lgtm Approve
Review via email: mp+456603@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Tests are still running, but I'd appreciate an upfront review so I can land the fix if the tests are fine

237. By Christian Ehrhardt 

Use dpkg compare-version

Instead of just hoping they are in order use dpkg compare-version
to identify which content needs to be (re-)rendered.

Revision history for this message
Paride Legovini (paride) wrote :

This looks all sensible to me, as usual the comments and commit messages are helpful. However I have no reasonable way to test this, so this review doesn't go much beyond the lgtm level.

review: Approve (lgtm)
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

FYI: Still debugging some more things to do it right this time. Will land some more commits before this is fully complete.

238. By Christian Ehrhardt 

rename src -> binpkg as we handle binary packages

Many archive tools handle source packages, but this parses and
iterates binaries. Make it less misleading by fixing the
variable names and log out put to say binpkg instead of calling
them src.

239. By Christian Ehrhardt 

Track versions in the right context

The while loop used to be a subshell behind curl + processing.
To properly track versions that were already handled it has to
move into the same context as the rest of the program.

While touching the decision making on which package to process
ensure that each path creates a log entry and make them all
follow the same pattern which eases log reading.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Full test of mantic + noble running over the weekend.

That serves as validation and also as time check to compare with the currently stuck production deployment.

240. By Christian Ehrhardt 

Remove debug output

Further unify output text and remove debug-only content.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Ok, the new code ran completely - generated the translated pages (see recent issues in RT 157256) and used the updated content (this issue). Also the former issues of getting $rel-updates paths is fixed.

We might need more to optimize performance a bit, but that is for a future MR.

Also approving to reflect the tests being completed

review: Approve
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Merged to trunk and production branches.
Asked in RT157256 to please redeploy the new code.

Revision history for this message
Bryce Harrington (bryce) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/make-manpage-repo.sh'
2--- bin/make-manpage-repo.sh 2023-11-27 09:37:26 +0000
3+++ bin/make-manpage-repo.sh 2023-12-01 14:25:15 +0000
4@@ -135,26 +135,47 @@
5 return 0
6 }
7
8-
9+declare -A pkg_handled
10 for dist in $DISTROS; do
11- # In some cases we do not want to know the pocket, as it would show up in
12- # paths, URLs and bug links, so strip it here if present
13- distnopocket=$(echo "${dist}" | cut -d '-' -f 1)
14- mkdir -p "$PUBLIC_HTML_DIR/manpages/$distnopocket/.cache" "$PUBLIC_HTML_DIR/manpages.gz/$distnopocket" || true
15- link_en_locale "$distnopocket"
16- for repo in $REPOS; do
17- for arch in $ARCH; do
18- file=$(get_packages_url "$dist" "$repo" "$arch")
19- echo "INFO: Packages.gz: $file"
20- curl -s "$file" \
21- | gunzip -c \
22- | grep -E "(^Filename: |^SHA1: )" \
23- | awk '{print $2}' \
24- | sed 'N;s/\n/ /' \
25- | sort -u \
26- | while read -r deb sum; do
27- handle_deb "$distnopocket" "$deb" "$sum"
28- done
29+ # On one hand in some cases we do not want to know the pocket, as it
30+ # would show up in paths, URLs and bug links
31+ distnopocket="${dist}"
32+ # Yet on the other hand we need to process all pockets. Without -release
33+ # we'd miss content that never got an update, without -updates we'd not
34+ # pick up changes.
35+ # It orders by likely most up-to-date pocket first and only re-renders if
36+ # a newer version of the same source package is found later (even single
37+ # Packages files can list the same source multiple times).
38+ pkg_handled=()
39+ for pocket in "-updates" "-security" ""; do
40+ mkdir -p "$PUBLIC_HTML_DIR/manpages/$distnopocket/.cache" "$PUBLIC_HTML_DIR/manpages.gz/$distnopocket" || true
41+ link_en_locale "$distnopocket"
42+ for repo in $REPOS; do
43+ for arch in $ARCH; do
44+ file=$(get_packages_url "${dist}${pocket}" "$repo" "$arch")
45+ echo "INFO: Packages.gz: $file"
46+ plist=$(mktemp "/tmp/XXXXXXX.manpages.${dist}${pocket}.$repo.$arch.plist")
47+ curl -s "$file" \
48+ | gunzip -c \
49+ | grep -E "(^Package: |^Version: |^Filename: |^SHA1: )" \
50+ | awk '{print $2}' \
51+ | sed 'N;N;N;s/\n/ /g' \
52+ | sort -u > "${plist}"
53+ while read -r binpkg version deb sum; do
54+ if dpkg --compare-versions "${version}" gt "${pkg_handled["$binpkg"]}"; then
55+ if [[ -n "${pkg_handled[$binpkg]}" ]]; then
56+ echo "INFO: binpkg: $binpkg ${version} > ${pkg_handled["$binpkg"]} (processing it again)"
57+ else
58+ echo "INFO: First encounter of binpkg: $binpkg ${version} (processing)"
59+ fi
60+ pkg_handled["$binpkg"]="${version}"
61+ handle_deb "$distnopocket" "$deb" "$sum"
62+ else
63+ echo "INFO: binpkg: $binpkg ${version} < ${pkg_handled["$binpkg"]} (not processing)"
64+ fi
65+ done < "${plist}"
66+ rm -f "${plist}"
67+ done
68 done
69 done
70 done
71
72=== modified file 'bin/manpages-modify-config'
73--- bin/manpages-modify-config 2023-11-27 08:35:42 +0000
74+++ bin/manpages-modify-config 2023-12-01 14:25:15 +0000
75@@ -23,12 +23,7 @@
76 continue
77 if s.name in series_blacklist:
78 continue
79- if s == current_series:
80- # Has no -updates yet
81- active_series.append(s.name)
82- else:
83- # To pick up changes we need to fetch updates package lists
84- active_series.append("%s-updates" % s.name)
85+ active_series.append(s.name)
86
87 out_str = ''
88 with open(config_fn) as f:

Subscribers

People subscribed via source and target branches