summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cooker.py
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2018-02-01 23:15:23 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-02-14 15:26:03 +0000
commit8abf7d89a56cf70cbb0fa068241bbd082c394043 (patch)
treea8f218146f9765b1696efceebd3251203afa26e9 /bitbake/lib/bb/cooker.py
parentfe70fd1a03dcbf516ee10866b8a68daf942c0a07 (diff)
downloadpoky-8abf7d89a56cf70cbb0fa068241bbd082c394043.tar.gz
bitbake: 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. (Bitbake rev: ec90245d28e52ea718d2ce084eb304cdc4355c9c) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r--bitbake/lib/bb/cooker.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index f0dab97974..f991c8f123 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1808,21 +1808,25 @@ class CookerCollectFiles(object):
1808 realfn, cls, mc = bb.cache.virtualfn2realfn(p) 1808 realfn, cls, mc = bb.cache.virtualfn2realfn(p)
1809 priorities[p] = self.calc_bbfile_priority(realfn, matched) 1809 priorities[p] = self.calc_bbfile_priority(realfn, matched)
1810 1810
1811 # Don't show the warning if the BBFILE_PATTERN did match .bbappend files
1812 unmatched = set() 1811 unmatched = set()
1813 for _, _, regex, pri in self.bbfile_config_priorities: 1812 for _, _, regex, pri in self.bbfile_config_priorities:
1814 if not regex in matched: 1813 if not regex in matched:
1815 unmatched.add(regex) 1814 unmatched.add(regex)
1816 1815
1817 def findmatch(regex): 1816 # Don't show the warning if the BBFILE_PATTERN did match .bbappend files
1817 def find_bbappend_match(regex):
1818 for b in self.bbappends: 1818 for b in self.bbappends:
1819 (bbfile, append) = b 1819 (bbfile, append) = b
1820 if regex.match(append): 1820 if regex.match(append):
1821 # If the bbappend is matched by already "matched set", return False
1822 for matched_regex in matched:
1823 if matched_regex.match(append):
1824 return False
1821 return True 1825 return True
1822 return False 1826 return False
1823 1827
1824 for unmatch in unmatched.copy(): 1828 for unmatch in unmatched.copy():
1825 if findmatch(unmatch): 1829 if find_bbappend_match(unmatch):
1826 unmatched.remove(unmatch) 1830 unmatched.remove(unmatch)
1827 1831
1828 for collection, pattern, regex, _ in self.bbfile_config_priorities: 1832 for collection, pattern, regex, _ in self.bbfile_config_priorities: