summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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:
1027 1027
1028 def findFilesMatchingInDir(self, filepattern, directory): 1028 def findFilesMatchingInDir(self, filepattern, directory):
1029 """ 1029 """
1030 Searches for files matching the regex 'pattern' which are children of 1030 Searches for files containing the substring 'filepattern' which are children of
1031 'directory' in each BBPATH. i.e. to find all rootfs package classes available 1031 'directory' in each BBPATH. i.e. to find all rootfs package classes available
1032 to BitBake one could call findFilesMatchingInDir(self, 'rootfs_', 'classes') 1032 to BitBake one could call findFilesMatchingInDir(self, 'rootfs_', 'classes')
1033 or to find all machine configuration files one could call: 1033 or to find all machine configuration files one could call:
1034 findFilesMatchingInDir(self, 'conf/machines', 'conf') 1034 findFilesMatchingInDir(self, '.conf', 'conf/machine')
1035 """ 1035 """
1036 1036
1037 matches = [] 1037 matches = []
1038 p = re.compile(re.escape(filepattern))
1039 bbpaths = self.data.getVar('BBPATH', True).split(':') 1038 bbpaths = self.data.getVar('BBPATH', True).split(':')
1040 for path in bbpaths: 1039 for path in bbpaths:
1041 dirpath = os.path.join(path, directory) 1040 dirpath = os.path.join(path, directory)
1042 if os.path.exists(dirpath): 1041 if os.path.exists(dirpath):
1043 for root, dirs, files in os.walk(dirpath): 1042 for root, dirs, files in os.walk(dirpath):
1044 for f in files: 1043 for f in files:
1045 if p.search(f): 1044 if filepattern in f:
1046 matches.append(f) 1045 matches.append(f)
1047 1046
1048 if matches: 1047 if matches: