From aedeabafd6ff401d8d285d4cc81232492915f76d Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Tue, 28 Aug 2018 14:19:55 -0400 Subject: cooker.py: Fix incorrect bb files matched warning In the case of a sublayer of an existing layer, where the sublayer and main layer share a path, the system may not match the paths properly resulting in: No bb files matched BBFILE_PATTERN_sublayer '^/path/main/sublayer' because it has already matched the main layer. Fix this issue by sorting the collection items based on the pattern, using longest to shortest. Obviously regex wildcards could still be an issue but these are typically not used, so this simply fix should work in the existing cases. Signed-off-by: Mark Hatle --- lib/bb/cooker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/bb/cooker.py') diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py index 946ba9ca0..d7e90f25d 100644 --- a/lib/bb/cooker.py +++ b/lib/bb/cooker.py @@ -1661,7 +1661,10 @@ class CookerExit(bb.event.Event): class CookerCollectFiles(object): def __init__(self, priorities): self.bbappends = [] - self.bbfile_config_priorities = priorities + # Priorities is a list of tupples, with the second element as the pattern. + # We need to sort the list with the longest pattern first, and so on to + # the shortest. This allows nested layers to be properly evaluated. + self.bbfile_config_priorities = sorted(priorities, key=lambda tup: tup[1], reverse=True) def calc_bbfile_priority( self, filename, matched = None ): for _, _, regex, pri in self.bbfile_config_priorities: -- cgit 1.2.3-korg