fix(build): cut the base version at v<digit>, not at the first 'v'

room-server-v1.17.0 won describe, and find("v") landed inside "server" --
so every board built tonight would have called itself ver-v1.17.0-tth56e1.
Earlier upstream tags (companion-, repeater-) have no 'v' in the prefix, which
is why this only surfaced now.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5 committed 2026-08-10 09:58:01 +02:00
1 parent e2552b9cc3
commit 0c474a08fd
1 file changed
+7 -2
+7 -2
View File
@@ -14,6 +14,7 @@
# FIRMWARE_BUILD_DATE (compile time). NOTE: the define changes every build =
# full rebuild each time (~10-30 s) -- the price for an always-fresh timestamp.
Import("env")
import re
import subprocess
from datetime import datetime
@@ -41,8 +42,12 @@ try:
tag = git(cwd, "describe", "--tags", "--abbrev=0",
"--match", "*v[0-9]*", "--exclude", "*+tth*",
"--exclude", "backup/*")
i = tag.find("v")
base = tag[i:] if i >= 0 else tag
# Cut at the 'v' that STARTS THE VERSION, not at the first 'v' in the tag:
# "room-server-v1.17.0" has one in "server", and find("v") turned the base
# into "ver-v1.17.0". Every earlier upstream tag we saw (companion-, repeater-)
# happened to have no 'v' in its prefix, so this hid until v1.17.0.
m = re.search(r"v[0-9]", tag)
base = tag[m.start():] if m else tag
except Exception:
pass