aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2015-12-18 12:23:14 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-08 13:58:08 +0000
commitbfa7859ffa42927214c429a6e081acc8027227c5 (patch)
treec8fdc49ef73e3e4f722c342922ab94895d1eabad /bitbake
parent3d4273716d6b6c2be2b2de774fd86dc6997eb95a (diff)
downloadopenembedded-core-contrib-bfa7859ffa42927214c429a6e081acc8027227c5.tar.gz
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 <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py7
1 files changed, 3 insertions, 4 deletions
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: