[oe-commits] [bitbake] 03/10: bitbake: cooker: fix for BBFILE_PATTERN matches bbappend

git at git.openembedded.org git at git.openembedded.org
Fri Feb 9 14:22:07 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit ec90245d28e52ea718d2ce084eb304cdc4355c9c
Author: Robert Yang <liezhi.yang at windriver.com>
AuthorDate: Thu Feb 1 23:15:23 2018 +0800

    bitbake: cooker: fix for BBFILE_PATTERN matches bbappend
    
    The old code couldn't handle nestled layers correctly, e.g.:
    parent_layer/sub_layer/foo.bb
    
    Note there are two layers, parent_layer and sub_layer.
    And in parent_layer/conf/layer.conf:
    BBFILE_PATTERN_parent_layer = ""^${LAYERDIR}/"
    
    This setting is incorrect since it also matches parent_layer/sub_layer/foo.bb,
    so it warns that no files matched sub_layer, this is the expected behavior, but
    it doesn't warn when there is a parent_layer/sub_layer/bar.bbappend, this was
    incorrect since the bbappend is also matched by BBFILE_PATTERN_parent_layer, it
    should warn and let the user fix the problem. Check the bbappend in already
    "matched set" before return it as matched by "unmatched set" can fix the problem.
    
    Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/cooker.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index f0dab97..f991c8f 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -1808,21 +1808,25 @@ class CookerCollectFiles(object):
             realfn, cls, mc = bb.cache.virtualfn2realfn(p)
             priorities[p] = self.calc_bbfile_priority(realfn, matched)
 
-        # Don't show the warning if the BBFILE_PATTERN did match .bbappend files
         unmatched = set()
         for _, _, regex, pri in self.bbfile_config_priorities:
             if not regex in matched:
                 unmatched.add(regex)
 
-        def findmatch(regex):
+        # Don't show the warning if the BBFILE_PATTERN did match .bbappend files
+        def find_bbappend_match(regex):
             for b in self.bbappends:
                 (bbfile, append) = b
                 if regex.match(append):
+                    # If the bbappend is matched by already "matched set", return False
+                    for matched_regex in matched:
+                        if matched_regex.match(append):
+                            return False
                     return True
             return False
 
         for unmatch in unmatched.copy():
-            if findmatch(unmatch):
+            if find_bbappend_match(unmatch):
                 unmatched.remove(unmatch)
 
         for collection, pattern, regex, _ in self.bbfile_config_priorities:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list