west: runners: add option 'v' prefix to OpenOCD version string

The Espressif branch of OpenOCD uses the version string "v0.12.0" instead
of "0.12.0" causing the version regex match to fail.

Add an optional 'v' prefix to avoid the failure.

Fixes: #83373
Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
This commit is contained in:
Eric Holmberg 2025-01-08 11:25:47 +13:00 committed by Benjamin Cabé
parent 7a189ae0fa
commit 3d42a1cfbc

View file

@ -222,7 +222,7 @@ class OpenOcdBinaryRunner(ZephyrBinaryRunner):
out = self.check_output([self.openocd_cmd[0], '--version'],
stderr=subprocess.STDOUT).decode()
version_match = re.search(r"Open On-Chip Debugger (\d+.\d+.\d+)", out)
version_match = re.search(r"Open On-Chip Debugger v?(\d+.\d+.\d+)", out)
version = version_match.group(1).split('.')
return [to_num(i) for i in version]