archlinux-s390x/patches/pkgbuild/autoconf-archive.sh
Mathieu Benoit 8a41d00a90 [FIX] our flit_core is too new, and savannah would not serve a patch
python-jinja: ERROR Missing dependencies: flit_core<4

flit_core is installed and importable -- 4.0.2. jinja's pyproject.toml pins
flit_core<4, so build refuses before compiling anything. A new shape here, and
the mirror image of one already recorded: libxslt could not be built on the host
because Ubuntu's libxml2 was too OLD; this is our own package being too NEW for
another's ceiling. Both read as a missing dependency and neither is one.
--skip-dependency-check is what Arch's own python-packaging passes for the same
class of reason.

  autoconf-archive: curl: (52) Empty reply from server

The tarball arrives fine from ftpmirror.gnu.org. What fails is one patch from
savannah's cgit /patch/?id= endpoint, which returns nothing while savannah's root
answers 302 -- measured on both, plus 200 and 2463 bytes from a git mirror for
the same commit hash. Asking a mirror for the SAME COMMIT changes where the bytes
come from, not which bytes they are.

Also: pkill -f "[c]url.*autoconf-arc" killed the shell running it, because the
pattern matched that shell's own command line. Fourth time in this port.

--- FR ---

  python-jinja: ERROR Missing dependencies: flit_core<4

flit_core est installé et importable — 4.0.2. Le pyproject.toml de jinja épingle
flit_core<4 : build refuse avant de compiler. Forme nouvelle ici, et miroir d'une
déjà consignée : libxslt ne se bâtissait pas sur l'hôte car le libxml2 d'Ubuntu
était trop ANCIEN ; ici notre propre paquet est trop RÉCENT pour le plafond d'un
autre. Les deux se lisent comme une dépendance manquante, aucune ne l'est.
--skip-dependency-check est ce que passe le python-packaging d'Arch pour la même
raison.

  autoconf-archive: curl: (52) Empty reply from server

L'archive arrive très bien de ftpmirror.gnu.org. Ce qui échoue est un correctif
tiré du point /patch/?id= de cgit chez savannah, qui ne renvoie rien alors que la
racine de savannah répond 302 — mesuré sur les deux, plus 200 et 2463 octets
depuis un miroir git pour le même commit. Demander le MÊME COMMIT à un miroir
change d'où viennent les octets, pas lesquels.

Aussi : pkill -f "[c]url.*autoconf-arc" a tué le shell qui l'exécutait, son motif
correspondant à la ligne de commande de ce shell. Quatrième fois dans ce portage.

Assisted-by: Claude Opus 5
2026-08-23 19:27:14 -04:00

47 lines
2.4 KiB
Bash
Executable file

#!/usr/bin/env bash
# autoconf-archive: take the patch from a mirror savannah's cgit will serve.
#
# curl: (52) Empty reply from server
# ==> ERROR: Failure while downloading
# https://cgit.git.savannah.gnu.org/cgit/autoconf-archive.git/patch/?id=241f7ae...
#
# The tarball comes from ftpmirror.gnu.org and arrives fine. What fails is a
# single patch fetched from savannah's cgit /patch/?id= endpoint, which returns
# nothing at all -- measured, not assumed:
#
# savannah /patch/?id= (no response)
# github /commit/.patch 200, 2463 bytes
#
# savannah itself is up (its root answers 302); it is that endpoint, which cgit
# generates on demand and rate-limits.
#
# The mirror is asked for THE SAME COMMIT, by its full hash, so this changes
# where the bytes come from and not which bytes they are -- the substantive
# difference from replacing a source with a different version of itself. GitHub
# renders `git format-patch` output where cgit renders its own; both are what
# `patch` expects, and the build fails loudly if that were untrue.
#
# WHY NOT DROP THE PATCH. It is 0001_fix_AX_CXX_COMPILE_STDCXX.patch, a fix to a
# macro this port needs -- tpm2-tss stopped on a missing AX_* macro, which is why
# autoconf-archive is in the list at all.
set -euo pipefail
python3 - <<'ZZPY'
import io, re
s = io.open("PKGBUILD", encoding="utf-8").read()
old = "https://cgit.git.savannah.gnu.org/cgit/autoconf-archive.git/patch/?id="
assert s.count(old) == 1, "autoconf-archive: expected one cgit patch URL, got %d" % s.count(old)
# The commit hash follows the URL, up to the closing quote. Reused verbatim: the
# point of the substitution is that the content is identical.
m = re.search(re.escape(old) + r"([0-9a-f]{40})", s)
assert m, "autoconf-archive: no 40-character commit hash after the cgit URL"
sha = m.group(1)
s = s.replace(old + sha,
"https://github.com/autoconf-archive/autoconf-archive/commit/%s.patch" % sha, 1)
io.open("PKGBUILD", "w", encoding="utf-8").write(s)
print(" patch commit: %s" % sha[:12])
ZZPY
grep -q "cgit.git.savannah.gnu.org" PKGBUILD && {
echo "autoconf-archive: a cgit URL survived" >&2; exit 1; }
grep -qE "github.com/autoconf-archive/autoconf-archive/commit/[0-9a-f]{40}\.patch" PKGBUILD || {
echo "autoconf-archive: the mirror URL is malformed" >&2; exit 1; }
echo "autoconf-archive: patch taken from the git mirror (same commit)"