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:
1 parent
e2552b9cc3
commit
0c474a08fd
1 file changed
+7
-2
@@ -14,6 +14,7 @@
|
|||||||
# FIRMWARE_BUILD_DATE (compile time). NOTE: the define changes every build =
|
# 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.
|
# full rebuild each time (~10-30 s) -- the price for an always-fresh timestamp.
|
||||||
Import("env")
|
Import("env")
|
||||||
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
@@ -41,8 +42,12 @@ try:
|
|||||||
tag = git(cwd, "describe", "--tags", "--abbrev=0",
|
tag = git(cwd, "describe", "--tags", "--abbrev=0",
|
||||||
"--match", "*v[0-9]*", "--exclude", "*+tth*",
|
"--match", "*v[0-9]*", "--exclude", "*+tth*",
|
||||||
"--exclude", "backup/*")
|
"--exclude", "backup/*")
|
||||||
i = tag.find("v")
|
# Cut at the 'v' that STARTS THE VERSION, not at the first 'v' in the tag:
|
||||||
base = tag[i:] if i >= 0 else 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:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user