diff mbox series

[rocko] utils: Adjusted host GCC version detection regex for current versions.

Message ID mt-W_TsNhhdIF8g4ynATsd1nSvn7JUzRSItDZ9vmpck2lJ9M-DTYZ5JiSgg60hPhOiBkl5eev7Hp68O3WxO0-2HupCQ6R3IbAJOpuxH-PdA=@protonmail.com
State New
Headers show
Series [rocko] utils: Adjusted host GCC version detection regex for current versions. | expand

Commit Message

Jochem Stevense Feb. 17, 2023, 7:15 p.m. UTC
utils: Adjusted host GCC version detection regex for
 current versions.

The regex only supported single digit version numbers, such as 9.0.1, I have adjusted this to be able to support versions such as 11.3.0

Signed-off-by: jochemste <jochemstevense@protonmail.com>
---
 meta/lib/oe/utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 643ab78df7..73b2f79e07 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -285,7 +285,7 @@  def host_gcc_version(d):
     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(".* (\d+\.\d+)\.\d+.*", output.split('\n')[0])
     if not match:
         bb.fatal("Can't get compiler version from %s --version output" % compiler)