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

Submitted by Robert Yang on Jan. 25, 2013, 8:35 a.m. | Patch ID: 43367


Message ID fd425b3b5b4efdb216ec8fa44d6373c42708d4e8.1359080497.git.liezhi.yang@windriver.com
State New
Headers show

Commit Message

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


They are two layers, the file:
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

[YOCTO #3387]

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

Patch hide | download patch | download mbox

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 "?"