Skip to content

Commit d610e2a

Browse files
west: runners: openocd: Handle ADI OpenOCD fork version format
The ADI fork of OpenOCD prints a modified version line; adjusting the regex to account for that different format when checking the OpenOCD version. Signed-off-by: Pete Johanson <[email protected]> (cherry picked from commit 1c05f21)
1 parent 34b5268 commit d610e2a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/west_commands/runners/openocd.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ def read_version(self):
232232
out = self.check_output([self.openocd_cmd[0], '--version'],
233233
stderr=subprocess.STDOUT).decode()
234234

235-
version_match = re.search(r"Open On-Chip Debugger v?(\d+.\d+.\d+)", out)
235+
# Account for version info format of ADI fork of OpenOCD as well
236+
version_match = re.search(r"Open On-Chip Debugger.* v?(\d+.\d+.\d+)[ \n]", out)
236237
version = version_match.group(1).split('.')
237238

238239
return [to_num(i) for i in version]

0 commit comments

Comments
 (0)