From bfa7859ffa42927214c429a6e081acc8027227c5 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Fri, 18 Dec 2015 12:23:14 +0000 Subject: bitbake: cooker: fix findFilesMatchingInDir documentation The documentation for findFilesMatchingInDir() was inconsistant with the implementation: the regex was escaped before searching so effectively it's a pure textual substring, and the machine example was broken. (Bitbake rev: 6bef981488ec94b46dbe3797acfecf9c4b6ecbbc) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- bitbake/lib/bb/cooker.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'bitbake/lib/bb/cooker.py') diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 8592d234a3..81d4dd1886 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -1027,22 +1027,21 @@ class BBCooker: def findFilesMatchingInDir(self, filepattern, directory): """ - Searches for files matching the regex 'pattern' which are children of + Searches for files containing the substring 'filepattern' which are children of 'directory' in each BBPATH. i.e. to find all rootfs package classes available to BitBake one could call findFilesMatchingInDir(self, 'rootfs_', 'classes') or to find all machine configuration files one could call: - findFilesMatchingInDir(self, 'conf/machines', 'conf') + findFilesMatchingInDir(self, '.conf', 'conf/machine') """ matches = [] - p = re.compile(re.escape(filepattern)) bbpaths = self.data.getVar('BBPATH', True).split(':') for path in bbpaths: dirpath = os.path.join(path, directory) if os.path.exists(dirpath): for root, dirs, files in os.walk(dirpath): for f in files: - if p.search(f): + if filepattern in f: matches.append(f) if matches: -- cgit v1.2.3-54-g00ecf