]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
utils: fix gcc 10 version detection
authorCharles-Antoine Couret <charles-antoine.couret@mind.be>
Thu, 26 Mar 2020 20:09:49 +0000 (21:09 +0100)
committerJeremy A. Puhlman <jpuhlman@mvista.com>
Thu, 16 Jul 2020 16:00:52 +0000 (09:00 -0700)
Utils can not detect GCC 10 correctly due to wrong regex.
It generates this error "ERROR: Can't get compiler version from gcc  --version output"

Sub-version numbers should be 1 or more digits instead of 1 only.

Signed-off-by: Charles-Antoine Couret <charles-antoine.couret@mind.be>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 186fe4a3d390a52b87282c3e694ce3251e45ee78)
Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
meta/lib/oe/utils.py

index 8a584d6ddd5ecf4a032abb552de8f18062bee40f..96ebc36b8b41f14d9e271af6578992aeacdea62f 100644 (file)
@@ -370,7 +370,7 @@ def host_gcc_version(d, taskcontextonly=False):
     except subprocess.CalledProcessError as e:
         bb.fatal("Error running %s --version: %s" % (compiler, e.output.decode("utf-8")))
 
-    match = re.match(".* (\d\.\d)\.\d.*", output.split('\n')[0])
+    match = re.match(r".* (\d+\.\d+)\.\d+.*", output.split('\n')[0])
     if not match:
         bb.fatal("Can't get compiler version from %s --version output" % compiler)