diff mbox series

[layerindex-web,2/5] layerindex/recipeparse.py: extend bbclass regex

Message ID b71fff21212356c32779b3a080653d76b377966e.1705982792.git.tim.orling@konsulko.com
State New
Headers show
Series [layerindex-web,1/5] layerindex/models: add BBClassRecipe BBClassGlobal | expand

Commit Message

Tim Orling Jan. 23, 2024, 4:15 a.m. UTC
Extend the bbclass regex to match classes-global and classes-recipe

[YOCTO #15238]

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 layerindex/recipeparse.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/layerindex/recipeparse.py b/layerindex/recipeparse.py
index 6202745..9be6c10 100644
--- a/layerindex/recipeparse.py
+++ b/layerindex/recipeparse.py
@@ -130,7 +130,7 @@  def setup_layer(config_data, fetchdir, layerdir, layer, layerbranch, logger):
 
 machine_conf_re = re.compile(r'conf/machine/([^/.]*).conf$')
 distro_conf_re = re.compile(r'conf/distro/([^/.]*).conf$')
-bbclass_re = re.compile(r'classes/([^/.]*).bbclass$')
+bbclass_re = re.compile(r'classes(?P<subtype>-global|-recipe)?/(?P<name>[^/.]*).bbclass$')
 def detect_file_type(path, subdir_start):
     typename = None
     if fnmatch.fnmatch(path, "*.bb"):
@@ -149,7 +149,7 @@  def detect_file_type(path, subdir_start):
         res = bbclass_re.match(subpath)
         if res:
             typename = 'bbclass'
-            return (typename, None, res.group(1))
+            return (typename, None, res.group('name'))
         res = distro_conf_re.match(subpath)
         if res:
             typename = 'distro'