chore(tools): bump-version bumps VERSION files
What changed, and why it matters
This is a routine developer tooling change. It extends an internal version-bumping script so it can also update plain-text VERSION files (used by a new Bluetooth project), in addition to the existing C header version files. There is no user-facing or security-relevant change to the firmware itself.
No security action required. Treat as normal maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies tools/bump-version.py to add a bump_version_file() helper that parses KEY = VALUE lines and rewrites VERSION_MAJOR, VERSION_MINOR, and PATCHLEVEL. The CLI now checks for a VERSION file before falling back to version.h, and the help text lists the new nordic/trezor/trezor-ble project. No cryptographic, runtime, or firmware code is touched.
Changed components
tools/bump-version.pyInspect captured patch +29 / −3
diff --git a/tools/bump-version.py b/tools/bump-version.py
index 43bbecf2f..55905be8f 100755
--- a/tools/bump-version.py
+++ b/tools/bump-version.py
@@ -8,9 +8,10 @@ import click
VERSION_RE = re.compile(r"^(\d+)[.](\d+)[.](\d+)$")
HEADER_LINE_RE = re.compile(r"^#define ([A-Z_]+) \S+$")
+VERSION_FILE_LINE_RE = re.compile(r"^([A-Z_]+) = \S+$")
-def bump_header(filename, **kwargs):
+def bump_header(filename: Path, **kwargs):
result_lines = []
with open(filename, "r+") as fh:
@@ -28,6 +29,24 @@ def bump_header(filename, **kwargs):
fh.write(line)
+def bump_version_file(filename: Path, **kwargs):
+ result_lines = []
+
+ with open(filename, "r+") as fh:
+ for line in fh:
+ m = VERSION_FILE_LINE_RE.match(line)
+ if m is not None and m[1] in kwargs:
+ symbol = m[1]
+ result_lines.append(f"{symbol} = {kwargs[symbol]}\n")
+ else:
+ result_lines.append(line)
+
+ fh.seek(0)
+ fh.truncate(0)
+ for line in result_lines:
+ fh.write(line)
+
+
def bump_python(subdir: Path, new_version: str):
subprocess.check_call(["uv", "version", new_version], cwd=subdir)
@@ -47,7 +66,7 @@ def hex_lit(version):
)
def cli(project, version):
"""Bump version for given project (core, python, legacy/firmware,
- legacy/bootloader, core/embed/projects/prodtest).
+ legacy/bootloader, core/embed/projects/prodtest, nordic/trezor/trezor-ble).
"""
project = Path(project)
@@ -58,7 +77,14 @@ def cli(project, version):
major, minor, patch = m.group(1, 2, 3)
parts = project.parts
- if (project / "version.h").is_file():
+ if (project / "VERSION").is_file():
+ bump_version_file(
+ project / "VERSION",
+ VERSION_MAJOR=major,
+ VERSION_MINOR=minor,
+ PATCHLEVEL=patch,
+ )
+ elif (project / "version.h").is_file():
bump_header(
project / "version.h",
VERSION_MAJOR=major,
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.