diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2018-08-29 10:52:17 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-09-05 18:01:37 +0100 |
commit | b7e26bedc2952e4ac0edface4bd20be22d7708cd (patch) | |
tree | 7eb6def35e254ae265cf7e4321c050a855a76ef9 /bitbake/lib/bb/cooker.py | |
parent | 2e9189c70ce60adee66fc602f684574bd305a4f9 (diff) | |
download | poky-b7e26bedc2952e4ac0edface4bd20be22d7708cd.tar.gz |
bitbake: 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.
(Bitbake rev: 1787cef7221b88f6920ea70fadaffc117d84c7aa)
Signed-off-by: Mark Hatle <mark.hatle@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.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 946ba9ca06..d7e90f25d2 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -1661,7 +1661,10 @@ class CookerExit(bb.event.Event): | |||
1661 | class CookerCollectFiles(object): | 1661 | class CookerCollectFiles(object): |
1662 | def __init__(self, priorities): | 1662 | def __init__(self, priorities): |
1663 | self.bbappends = [] | 1663 | self.bbappends = [] |
1664 | self.bbfile_config_priorities = priorities | 1664 | # Priorities is a list of tupples, with the second element as the pattern. |
1665 | # We need to sort the list with the longest pattern first, and so on to | ||
1666 | # the shortest. This allows nested layers to be properly evaluated. | ||
1667 | self.bbfile_config_priorities = sorted(priorities, key=lambda tup: tup[1], reverse=True) | ||
1665 | 1668 | ||
1666 | def calc_bbfile_priority( self, filename, matched = None ): | 1669 | def calc_bbfile_priority( self, filename, matched = None ): |
1667 | for _, _, regex, pri in self.bbfile_config_priorities: | 1670 | for _, _, regex, pri in self.bbfile_config_priorities: |