]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
windows: fix version check for win32 204/head
authorVictor Julien <victor@inliniac.net>
Thu, 26 Mar 2020 05:38:10 +0000 (06:38 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 26 Mar 2020 11:21:34 +0000 (12:21 +0100)
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.

run.py

diff --git a/run.py b/run.py
index f790478e640f51dc74eb4df922ccb1118d6a06d9..2c3197f841851bb98cb6bf5ee25190e074917bb4 100755 (executable)
--- 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