mkdist: name zips by the BT411_<version> convention (btversion.h)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-21 10:09:37 -05:00
co-authored by Claude Opus 4.8
parent f7e674d9cb
commit 8765ea3571
+14 -4
View File
@@ -17,6 +17,7 @@ bindings.txt keymap) with the pod build as fallback.
Usage: python tools/mkdist.py [outdir] (default outdir = dist/)
"""
import os
import re
import subprocess
import sys
import time
@@ -29,10 +30,19 @@ def main():
outdir = sys.argv[1] if len(sys.argv) > 1 else os.path.join(REPO, "dist")
os.makedirs(outdir, exist_ok=True)
githash = subprocess.check_output(
["git", "rev-parse", "--short", "HEAD"]).decode().strip()
stamp = time.strftime("%Y-%m-%d")
name = "BT411-%s-%s" % (stamp, githash)
# Name by the repo version convention (BT411_4.11.NNN, tools/btversion.cmake:
# build = commit count). Falls back to date+hash if the header is absent.
name = None
for h in ("build/btversion.h", "build-glass/btversion.h"):
if os.path.exists(h):
m = re.search(r'BT_VERSION_STRING\s+"([^"]+)"', open(h).read())
if m:
name = "BT411_" + m.group(1)
break
if name is None:
githash = subprocess.check_output(
["git", "rev-parse", "--short", "HEAD"]).decode().strip()
name = "BT411-%s-%s" % (time.strftime("%Y-%m-%d"), githash)
zpath = os.path.join(outdir, name + ".zip")
tracked = subprocess.check_output(