publish-manifest.sh: a carried app entry keeps its own ui_version or none; only a new entry is stamped from the tree (a carried 0.3.21 entry had taken the tree's 1.0.2 and passed the pair check falsely)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
igneum-labs 2026-10-07 18:42:05 +00:00
parent 9e42badf23
commit 83b8c8bd74

View file

@ -181,7 +181,7 @@ if [ -f "$OLD" ]; then
OLD_VERSION="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1])).get("version",""))' "$OLD" 2>/dev/null || true)"
if [ "$OLD_VERSION" = "$VERSION" ]; then
for p in mac windows; do
carried="$(python3 -c 'import json,sys; e=json.load(open(sys.argv[1])).get("platforms",{}).get(sys.argv[2]); print(" ".join([e["url"],e["sha256"],str(e["size"]),e["kind"],e.get("ui_version","")]).rstrip() if e else "")' "$OLD" "$p" 2>/dev/null || true)"
carried="$(python3 -c 'import json,sys; e=json.load(open(sys.argv[1])).get("platforms",{}).get(sys.argv[2]); print(" ".join([e["url"],e["sha256"],str(e["size"]),e["kind"],e.get("ui_version") or "-"]) if e else "")' "$OLD" "$p" 2>/dev/null || true)"
if [ "$p" = mac ] && [ -z "$MAC_ENTRY" ] && [ -n "$carried" ]; then MAC_ENTRY="$carried"; echo "mac: carried over from the current manifest"; fi
if [ "$p" = windows ] && [ -z "$WIN_ENTRY" ] && [ -n "$carried" ]; then WIN_ENTRY="$carried"; echo "windows: carried over from the current manifest"; fi
done
@ -268,8 +268,9 @@ def entry(s, ui_version=None):
parts = s.split()
url, sha, size, kind = parts[:4]
e = {"url": url, "sha256": sha, "size": int(size), "kind": kind}
# the version pair (tools/ui-ota/pair-check.mjs): the interface version of the UI tree this entry was built from
uv = parts[4] if len(parts) > 4 else ui_version
# the version pair (tools/ui-ota/pair-check.mjs): a NEW entry is built from this tree and carries its interface version;
# a carried entry keeps its own ("-" = it had none, and none is stamped: the tree's version is not its proof)
uv = (None if parts[4] == "-" else parts[4]) if len(parts) > 4 else ui_version
if uv: e["ui_version"] = uv
return e
m = {