From: Victor Julien Date: Thu, 26 Mar 2020 05:38:10 +0000 (+0100) Subject: windows: fix version check for win32 X-Git-Tag: suricata-6.0.4~321 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e173806944ead6e43f9feb8ce3db0e01dd2ecc5;p=thirdparty%2Fsuricata-verify.git windows: fix version check for win32 There may be leading output before the expected version string, so make sure to be a bit stricter on in the regex to extract the version correctly. --- diff --git a/run.py b/run.py index f790478e6..2c3197f84 100755 --- a/run.py +++ b/run.py @@ -91,7 +91,7 @@ SuricataVersion = namedtuple( "SuricataVersion", ["major", "minor", "patch"]) def parse_suricata_version(buf): - m = re.search("(\d+)\.?(\d+)?\.?(\d+)?.*", str(buf).strip()) + m = re.search("(?:Suricata version |^)(\d+)\.?(\d+)?\.?(\d+)?.*", str(buf).strip()) if m: major = int(m.group(1)) if m.group(1) else 0 minor = int(m.group(2)) if m.group(2) else 0