Commit 1c05f212 authored by Pete Johanson's avatar Pete Johanson Committed by Anas Nashif
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: default avatarPete Johanson <pete.johanson@analog.com>
parent 3598c413
Loading
Loading
Loading
Loading
+2 −1
Changes for scripts/west_commands/runners/openocd.py: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -232,7 +232,8 @@ 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 v?(\d+.\d+.\d+)", out)
        # Account for version info format of ADI fork of OpenOCD as well
        version_match = re.search(r"Open On-Chip Debugger.* v?(\d+.\d+.\d+)[ \n]", out)
        version = version_match.group(1).split('.')

        return [to_num(i) for i in version]