archlinux-s390x/patches/pkgbuild/util-linux.sh

35 lines
1.6 KiB
Bash
Raw Normal View History

[FIX] sqlite, libpsl and util-linux sqlite is the deferred item this port had written down long ago -- "libtcl8.6 versus our tcl 9.0" -- arriving as a missing directory: mv: cannot stat '<pkgdir>/usr/lib/tcl8.6/sqlite*': No such file or directory The version is read from the tree rather than written in, because the tcl package decides it and hardcoding 9.0 puts the same trap back one release later. The first attempt guarded with a blanket `grep tcl8.6` and condemned correct code: the existing section of that hook names tcl8.6 on purpose, because it is about the HOST's tcl. It also substituted $_tcldir into that older section, before the variable was defined. The guard caught both. util-linux is the seventh package to fail on a path at the end of package() after a compile that worked. libpsl's error names its own fix. --- FR --- sqlite est l'élément différé que ce portage avait noté depuis longtemps — « libtcl8.6 contre notre tcl 9.0 » — arrivant sous la forme d'un répertoire absent : mv: cannot stat '<pkgdir>/usr/lib/tcl8.6/sqlite*': No such file or directory La version est lue dans l'arbre plutôt qu'écrite en dur, parce que c'est le paquet tcl qui la décide et qu'inscrire 9.0 remettrait le même piège une version plus tard. La première tentative gardait par un `grep tcl8.6` global et condamnait du code juste : la section existante de ce hook nomme tcl8.6 exprès, car elle traite du tcl de l'HÔTE. Elle avait aussi injecté $_tcldir dans cette section antérieure, avant que la variable soit définie. Le garde a attrapé les deux. util-linux est le septième paquet à échouer sur un chemin en fin de package() après une compilation réussie. L'erreur de libpsl nomme son propre correctif. Assisted-by: Claude Opus 5
2026-08-22 07:33:10 -04:00
#!/usr/bin/env bash
# util-linux: the man3 pages that were never built.
#
# mv: cannot stat '<pkgdir>/usr/share/man/man3': No such file or directory
#
# util-linux renders its man pages from asciidoc, which this port does not have,
# so man3 does not exist. The util-linux-libs split moves it out of pkgdir and
# then back in -- TWO places, and removing only the first fails on the second.
#
# Both moves go. Nothing is left conditional: if the directory is never created,
# a guard around moving it is a guard around nothing, and it would read as if
# the man pages were sometimes present.
#
# Same shape as libxml2's docs split, pam's PDFs, libuv's man page and cmake's
# emacs byte-compilation: a failure on a path at the end of package(), after a
# compile that worked. Seventh time.
set -euo pipefail
python3 - <<'ZZPY'
import io, re
lines = io.open("PKGBUILD", encoding="utf-8").read().split("\n")
hit = [i for i, l in enumerate(lines)
if re.search(r"\bman3\b", l) and l.lstrip().startswith("mv ")]
assert len(hit) == 2, "util-linux: expected two man3 moves, got %d" % len(hit)
for i in reversed(hit):
ind = re.match(r"^[ \t]*", lines[i]).group(0)
lines[i] = ind + ": # man3 not built: no asciidoc at either stage."
io.open("PKGBUILD", "w", encoding="utf-8").write("\n".join(lines))
ZZPY
if grep -qE "^[[:space:]]*mv .*\bman3\b" PKGBUILD; then
echo "util-linux: a man3 move survived" >&2; exit 1
fi
grep -c "man3 not built" PKGBUILD | grep -qx 2 || {
echo "util-linux: expected both moves replaced" >&2; exit 1; }
echo "util-linux: man3 moves removed (both)"