diff --git a/scripts/lib/checklayer/__init__.py b/scripts/lib/checklayer/__init__.py
index 5fc2ef7058..3166593e10 100644
--- a/scripts/lib/checklayer/__init__.py
+++ b/scripts/lib/checklayer/__init__.py
@@ -228,7 +228,7 @@ def add_layers(bblayersconf, layers, logger):
     # Don't add a layer that is already present.
     added = set()
     output = check_command('Getting existing layers failed.', 'bitbake-layers show-layers').decode('utf-8')
-    for layer, path, pri in re.findall(r'^(\S+) +([^\n]*?) +(\d+)$', output, re.MULTILINE):
+    for layer, path, version in re.findall(r'^(\S+)  +([^\n]*?)  +(\d+)(?:  +[^\n]*)?$', output, re.MULTILINE):
         added.add(path)
 
     with open(bblayersconf, 'a+') as f:
