Fix: installierte Engine-Build-Nummer lesen (Format 'version: NNNN') + .gitattributes (LF)

- _installed_engine_build matchte nur 'build: <hash> (N)' / 'bNNNN', aber der
  aktuelle llama-server meldet 'version: 9821 (hash)'. Dadurch war installed_build
  immer None → Engine-Badge fiel auf ungenauen mtime-Vergleich zurueck. Jetzt
  praeziser Build-Nummer-Vergleich (latest > installed).
- .gitattributes erzwingt LF fuer *.sh/*.service/*.timer: die Box hatte
  core.autocrlf aktiv und checkte deploy.sh mit CRLF aus -> 'set -euo pipefail'
  wurde zu 'pipefail\r' (invalid option name), Deploy brach ab.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hitonabi
2026-06-28 10:58:59 +02:00
parent e2b3bb7088
commit 7bc20a6302
2 changed files with 16 additions and 1 deletions
+4 -1
View File
@@ -42,7 +42,10 @@ def _installed_engine_build() -> int | None:
out = subprocess.run([bin_path, "--version"], capture_output=True, text=True,
timeout=20, env=env)
txt = (out.stderr or "") + (out.stdout or "")
if (m := re.search(r"build:\s*\S+\s*\((\d+)\)", txt)) or (m := re.search(r"\bb(\d{3,})\b", txt)):
# Formate je nach Build: "version: 9821 (hash)" (aktuell), "build: <hash> (9821)", "b9821".
if (m := re.search(r"version:\s*(\d{3,})", txt)) \
or (m := re.search(r"build:\s*\S+\s*\((\d+)\)", txt)) \
or (m := re.search(r"\bb(\d{3,})\b", txt)):
return int(m.group(1))
except Exception:
return None