mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 00:06:36 +00:00
c164b88ac1
Different builds of Flex on different platforms output different strings in --version. For example: macOS: flex 2.5.35 Apple(flex-31) Windows: win_flex.exe 2.6.4 C:\Program Files (x86)\GnuWin32\bin\flex.EXE version 2.5.4 We need to look for a string that looks like a version, which means a regex till https://github.com/mesonbuild/meson/issues/1609 is fixed. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/356
11 lines
295 B
Python
11 lines
295 B
Python
#!/usr/bin/env python3
|
|
|
|
import re
|
|
import sys
|
|
import subprocess
|
|
|
|
flex = sys.argv[1]
|
|
|
|
out = subprocess.check_output([flex, '--version'], universal_newlines=True,
|
|
stderr=subprocess.STDOUT, stdin=subprocess.DEVNULL)
|
|
print(re.search(r'(\d+\.\d+(\.\d+)?)', out).group())
|