소스 검색

Reconcile RECORD checksums after normalising the vendored shebangs

The shebang normalisation left five files whose checksums no longer matched
their RECORD — the console scripts of httpx, idna and websockets, in three
platform trees. A plain vendor refresh is self-consistent; a hand-normalised one
is not, and the mismatch surfaces at install time on someone else's machine,
where an installer that verifies hashes rejects the tree outright.

So the reconciliation belongs in the vendoring script rather than in a patch
someone has to remember: after the sed, every RECORD entry pointing at an
existing file gets its sha256 and size recomputed. Recursive over all RECORDs,
because the __pycache__ cleanup above already dropped entries from them.

Verified: 662 entries, 0 mismatches, chattolib still imports, 303 tests green.
Paul Klumpp 2 주 전
부모
커밋
07bf2ed207

+ 1 - 1
vendor/common/httpx-0.28.1.dist-info/RECORD

@@ -1,4 +1,4 @@
-bin/httpx,sha256=czdBEaAWU7fpcxSlbwKc-zi3s9OSfyCbxd_N7CT56SA,342
+bin/httpx,sha256=JYr0-QFetUxyF-POsrfy2JgtMGDyqhD42_aBgedHyOs,291
 httpx-0.28.1.dist-info/INSTALLER,sha256=5hhM4Q4mYTT9z6QB6PGpUAW81PGNFrYrdXMj4oM_6ak,2
 httpx-0.28.1.dist-info/METADATA,sha256=_rubD48-gNV8gZnDBPNcQzboWB0dGNeYPJJ2a4J5OyU,7052
 httpx-0.28.1.dist-info/RECORD,,

+ 1 - 1
vendor/common/idna-3.20.dist-info/RECORD

@@ -1,4 +1,4 @@
-bin/idna,sha256=ylmFz6zvi9t3jzll-M6E9YGE9BXknOO6Ez80zgBZWc4,345
+bin/idna,sha256=FRtQKtCtN3_VQYYHRtyjNcY4Vezi6ecFr7YGBgLXCTk,294
 idna-3.20.dist-info/INSTALLER,sha256=5hhM4Q4mYTT9z6QB6PGpUAW81PGNFrYrdXMj4oM_6ak,2
 idna-3.20.dist-info/METADATA,sha256=29jBTB5MoeDJgkptvHy794iE8461LZEUjNMCX2ceS4U,7207
 idna-3.20.dist-info/RECORD,,

+ 1 - 1
vendor/platform/linux-aarch64/websockets-17.2.dist-info/RECORD

@@ -1,4 +1,4 @@
-bin/websockets,sha256=AGGFJV_GG4da2SbZbypam-CD5Geds29dhek1uf2VwA0,351
+bin/websockets,sha256=CqURjESKcWTpUZ6uXM1N_o080MU7CWWTfe-cWLbxU_4,300
 websockets-17.2.dist-info/INSTALLER,sha256=5hhM4Q4mYTT9z6QB6PGpUAW81PGNFrYrdXMj4oM_6ak,2
 websockets-17.2.dist-info/METADATA,sha256=DV8SedCV57qE7yFhSvCCLcUAzLLlG3w6Ge2nFZstreQ,6336
 websockets-17.2.dist-info/RECORD,,

+ 1 - 1
vendor/platform/linux-x86_64/websockets-17.2.dist-info/RECORD

@@ -1,4 +1,4 @@
-bin/websockets,sha256=AGGFJV_GG4da2SbZbypam-CD5Geds29dhek1uf2VwA0,351
+bin/websockets,sha256=CqURjESKcWTpUZ6uXM1N_o080MU7CWWTfe-cWLbxU_4,300
 websockets-17.2.dist-info/INSTALLER,sha256=5hhM4Q4mYTT9z6QB6PGpUAW81PGNFrYrdXMj4oM_6ak,2
 websockets-17.2.dist-info/METADATA,sha256=DV8SedCV57qE7yFhSvCCLcUAzLLlG3w6Ge2nFZstreQ,6336
 websockets-17.2.dist-info/RECORD,,

+ 1 - 1
vendor/platform/macos-arm64/websockets-17.2.dist-info/RECORD

@@ -1,4 +1,4 @@
-bin/websockets,sha256=AGGFJV_GG4da2SbZbypam-CD5Geds29dhek1uf2VwA0,351
+bin/websockets,sha256=CqURjESKcWTpUZ6uXM1N_o080MU7CWWTfe-cWLbxU_4,300
 websockets-17.2.dist-info/INSTALLER,sha256=5hhM4Q4mYTT9z6QB6PGpUAW81PGNFrYrdXMj4oM_6ak,2
 websockets-17.2.dist-info/METADATA,sha256=DV8SedCV57qE7yFhSvCCLcUAzLLlG3w6Ge2nFZstreQ,6336
 websockets-17.2.dist-info/RECORD,,

+ 40 - 0
vendor_chattolib.sh

@@ -116,6 +116,46 @@ find "$VENDOR_DIR" -type d -name "__pycache__" -exec rm -rf {} + 2> /dev/null ||
 echo "🔧 Normalisiere Shebangs der Konsolenskripte..."
 find "$VENDOR_DIR" -type f -path "*/bin/*" -exec sed -i '1s|^#!.*|#!/usr/bin/env python3|' {} + 2> /dev/null || true
 
+# …und danach die RECORDs wieder mit dem Baum in Einklang bringen. Wer den Hash
+# nicht anpasst, liefert fünf Dateien aus, deren Prüfsumme nicht mehr stimmt —
+# das fällt erst beim Installer auf, nicht hier. Rekursiv über alle RECORDs, weil
+# das Aufräumen von __pycache__ oben ebenfalls Einträge entfernt hat.
+echo "🔧 Aktualisiere RECORD-Prüfsummen..."
+python3 - "$VENDOR_DIR" <<'PYTHON_RECORD'
+import base64
+import csv
+import hashlib
+import sys
+from pathlib import Path
+
+vendor = Path(sys.argv[1])
+fixed = 0
+for record in vendor.rglob("RECORD"):
+    base = record.parent.parent
+    rows = list(csv.reader(record.read_text(encoding="utf-8").splitlines()))
+    changed = False
+    for row in rows:
+        if len(row) < 3 or not row[0] or "=" not in row[1]:
+            continue
+        target = base / row[0]
+        if not target.is_file():
+            continue
+        digest = base64.urlsafe_b64encode(
+            hashlib.sha256(target.read_bytes()).digest()
+        ).rstrip(b"=").decode()
+        size = str(target.stat().st_size)
+        if row[1] != f"sha256={digest}" or row[2] != size:
+            row[1], row[2] = f"sha256={digest}", size
+            changed = True
+    if changed:
+        out = []
+        for row in rows:
+            out.append(",".join(row))
+        record.write_text("\n".join(out) + "\n", encoding="utf-8")
+        fixed += 1
+print(f"   {fixed} RECORD(s) angepasst")
+PYTHON_RECORD
+
 echo "🔍 Verifiziere Import für die aktuelle Plattform..."
 if python3 -c "
 import sys