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
=== modified file 'bin/make-manpage-repo.sh'
--- bin/make-manpage-repo.sh 2023-11-27 09:37:26 +0000
+++ bin/make-manpage-repo.sh 2023-12-01 14:25:15 +0000
@@ -135,26 +135,47 @@
135 return 0135 return 0
136}136}
137137
138138declare -A pkg_handled
139for dist in $DISTROS; do139for dist in $DISTROS; do
140 # In some cases we do not want to know the pocket, as it would show up in140 # On one hand in some cases we do not want to know the pocket, as it
141 # paths, URLs and bug links, so strip it here if present141 # would show up in paths, URLs and bug links
142 distnopocket=$(echo "${dist}" | cut -d '-' -f 1)142 distnopocket="${dist}"
143 mkdir -p "$PUBLIC_HTML_DIR/manpages/$distnopocket/.cache" "$PUBLIC_HTML_DIR/manpages.gz/$distnopocket" || true143 # Yet on the other hand we need to process all pockets. Without -release
144 link_en_locale "$distnopocket"144 # we'd miss content that never got an update, without -updates we'd not
145 for repo in $REPOS; do145 # pick up changes.
146 for arch in $ARCH; do146 # It orders by likely most up-to-date pocket first and only re-renders if
147 file=$(get_packages_url "$dist" "$repo" "$arch")147 # a newer version of the same source package is found later (even single
148 echo "INFO: Packages.gz: $file"148 # Packages files can list the same source multiple times).
149 curl -s "$file" \149 pkg_handled=()
150 | gunzip -c \150 for pocket in "-updates" "-security" ""; do
151 | grep -E "(^Filename: |^SHA1: )" \151 mkdir -p "$PUBLIC_HTML_DIR/manpages/$distnopocket/.cache" "$PUBLIC_HTML_DIR/manpages.gz/$distnopocket" || true
152 | awk '{print $2}' \152 link_en_locale "$distnopocket"
153 | sed 'N;s/\n/ /' \153 for repo in $REPOS; do
154 | sort -u \154 for arch in $ARCH; do
155 | while read -r deb sum; do155 file=$(get_packages_url "${dist}${pocket}" "$repo" "$arch")
156 handle_deb "$distnopocket" "$deb" "$sum"156 echo "INFO: Packages.gz: $file"
157 done157 plist=$(mktemp "/tmp/XXXXXXX.manpages.${dist}${pocket}.$repo.$arch.plist")
158 curl -s "$file" \
159 | gunzip -c \
160 | grep -E "(^Package: |^Version: |^Filename: |^SHA1: )" \
161 | awk '{print $2}' \
162 | sed 'N;N;N;s/\n/ /g' \
163 | sort -u > "${plist}"
164 while read -r binpkg version deb sum; do
165 if dpkg --compare-versions "${version}" gt "${pkg_handled["$binpkg"]}"; then
166 if [[ -n "${pkg_handled[$binpkg]}" ]]; then
167 echo "INFO: binpkg: $binpkg ${version} > ${pkg_handled["$binpkg"]} (processing it again)"
168 else
169 echo "INFO: First encounter of binpkg: $binpkg ${version} (processing)"
170 fi
171 pkg_handled["$binpkg"]="${version}"
172 handle_deb "$distnopocket" "$deb" "$sum"
173 else
174 echo "INFO: binpkg: $binpkg ${version} < ${pkg_handled["$binpkg"]} (not processing)"
175 fi
176 done < "${plist}"
177 rm -f "${plist}"
178 done
158 done179 done
159 done180 done
160done181done
161182
=== modified file 'bin/manpages-modify-config'
--- bin/manpages-modify-config 2023-11-27 08:35:42 +0000
+++ bin/manpages-modify-config 2023-12-01 14:25:15 +0000
@@ -23,12 +23,7 @@
23 continue23 continue
24 if s.name in series_blacklist:24 if s.name in series_blacklist:
25 continue25 continue
26 if s == current_series:26 active_series.append(s.name)
27 # Has no -updates yet
28 active_series.append(s.name)
29 else:
30 # To pick up changes we need to fetch updates package lists
31 active_series.append("%s-updates" % s.name)
3227
33out_str = ''28out_str = ''
34with open(config_fn) as f:29with open(config_fn) as f:

Subscribers

People subscribed via source and target branches