Patchwork [bitbake-devel,1/2] bitbake-layers: fix get_file_layer

login
register
mail settings
Submitter Robert Yang
Date Jan. 25, 2013, 8:35 a.m.
Message ID <fd425b3b5b4efdb216ec8fa44d6373c42708d4e8.1359080497.git.liezhi.yang@windriver.com>
Download mbox | patch
Permalink /patch/43367/
State New
Headers show

Comments

Robert Yang - Jan. 25, 2013, 8:35 a.m.
The get_file_layer can't handle the nested layer correctly, e.g.:

meta-intel/conf/layer.conf
meta-intel/meta-cedartrail/conf/layer.conf

They are two layers, the file:
meta-intel/common/recipes-bsp/amt/lms_7.1.20.bb
belongs to meta-intel's layer, but the get_file_layer() may return
meta-cedartrail accordig to BBLAYERS' order, since it uses:

for layerdir in self.bblayers:
    if regex.match(os.path.join(layerdir, 'test')):
        return self.get_layer_name(layerdir)

which doesn't care the filename, re-match the filename would fix the
problem.

[YOCTO #3387]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 bitbake/bin/bitbake-layers |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers
index fa4e767..956e7a9 100755
--- a/bitbake/bin/bitbake-layers
+++ b/bitbake/bin/bitbake-layers
@@ -26,6 +26,7 @@  import os
 import sys
 import fnmatch
 from collections import defaultdict
+import re
 
 bindir = os.path.dirname(__file__)
 topdir = os.path.dirname(bindir)
@@ -458,7 +459,7 @@  build results (as the layer priority order has effectively changed).
         for layer, _, regex, _ in self.bbhandler.cooker.status.bbfile_config_priorities:
             if regex.match(filename):
                 for layerdir in self.bblayers:
-                    if regex.match(os.path.join(layerdir, 'test')):
+                    if regex.match(os.path.join(layerdir, 'test')) and re.match(layerdir, filename):
                         return self.get_layer_name(layerdir)
         return "?"