aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/base.py
diff options
context:
space:
mode:
authorGerion Entrup <gerion.entrup@flump.de>2020-02-14 13:03:39 +0100
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2020-02-17 01:10:40 +0530
commitb1304f729079fdc07523904902273ac581cfb702 (patch)
tree0a8840f64d7b3c2d96464d19f9a4a0c7e9a3f8bb /mesonbuild/dependencies/base.py
parent08d8cfbbb676913398aed2f9d3d5253d1aef9735 (diff)
downloadmeson-b1304f729079fdc07523904902273ac581cfb702.zip
meson-b1304f729079fdc07523904902273ac581cfb702.tar.gz
meson-b1304f729079fdc07523904902273ac581cfb702.tar.bz2
version parsing: match only when version starts with a number
This leads to better version parsing. An concrete example use case is llc. When invoking llc with "--version", the output is ``` LLVM (http://llvm.org/): LLVM version 9.0.1 ... ``` The old version parsing recognizes the dot in the first line as version. This commit also tries to adapt the two regexes to each other. Reported-by: Björn Fiedler <fiedler@sra.uni-hannover.de>
Diffstat (limited to 'mesonbuild/dependencies/base.py')
-rw-r--r--mesonbuild/dependencies/base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index fac7435..6f8181d 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -388,7 +388,7 @@ class ConfigToolDependency(ExternalDependency):
tools = None
tool_name = None
- __strip_version = re.compile(r'^[0-9.]*')
+ __strip_version = re.compile(r'^[0-9][0-9.]+')
def __init__(self, name, environment, kwargs, language: T.Optional[str] = None):
super().__init__('config-tool', environment, kwargs, language=language)