What changed, and why it matters
This is a small fix to a developer helper script that generates manual pages for Bitcoin Core command-line programs. A previous change caused the script to grab the wrong word from the program's version output, so it could not build the man pages. The patch uses a regular expression to reliably find the version string. It does not change any network, wallet, or consensus code and has no security relevance.
No security action needed. Treat as a normal build/maintenance fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies contrib/devtools/gen-manpages.py. Previously the script assumed the version token was the last whitespace-separated word on the first line of –version output. After commit 0972f5504021b482b27523fd3bcb8036cf6b439c, some binaries (e.g. bitcoind) have additional trailing text on that line, so the last word is no longer the version. The patch uses re.search(r”v[0-9]\S+”, output) to locate the version token, asserts it exists, and continues. This is a build-tooling correctness fix only.
Changed components
contrib/devtools/gen-manpages.pyInspect captured patch +6 / −4
diff --git a/contrib/devtools/gen-manpages.py b/contrib/devtools/gen-manpages.py
index 12d16157..02e5f839 100755
--- a/contrib/devtools/gen-manpages.py
+++ b/contrib/devtools/gen-manpages.py
@@ -3,6 +3,7 @@
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import os
+import re
import subprocess
import sys
import tempfile
@@ -59,10 +60,11 @@ for relpath in BINARIES:
print(f'{abspath} not found or not an executable', file=sys.stderr)
sys.exit(1)
# take first line (which must contain version)
- verstr = r.stdout.splitlines()[0]
- # last word of line is the actual version e.g. v22.99.0-5c6b3d5b3508
- verstr = verstr.split()[-1]
- assert verstr.startswith('v')
+ output = r.stdout.splitlines()[0]
+ # find the version e.g. v30.99.0-ce771726f3e7
+ search = re.search(r"v[0-9]\S+", output)
+ assert search
+ verstr = search.group(0)
# remaining lines are copyright
copyright = r.stdout.split('\n')[1:]
assert copyright[0].startswith('Copyright (C)')
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.