From 3939a216a53f58831e640e85ed95f7edff3ca76f Mon Sep 17 00:00:00 2001 From: Joshua Lock Date: Tue, 4 Jan 2011 20:28:20 +0000 Subject: bitbake: implement command to find configuration files for a config variable Some configuration variables (MACHINE, MACHINE-SDK and DISTRO) set which confguration files bitbake should use. The added command , findConfigFiles, enables a UI to query which files are suitable values for a specified parameter. Signed-off-by: Joshua Lock --- bitbake/lib/bb/cooker.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'bitbake/lib/bb/cooker.py') diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index e30fde0743..23388d8c97 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -430,8 +430,32 @@ class BBCooker: if not regex in matched: collectlog.warn("No bb files matched BBFILE_PATTERN_%s '%s'" % (collection, pattern)) + def findConfigFiles(self, varname): + """ + Find config files which are appropriate values for varname. + i.e. MACHINE, DISTRO + """ + possible = [] + var = varname.lower() + + data = self.configuration.data + # iterate configs + bbpaths = bb.data.getVar('BBPATH', data, True).split(':') + for path in bbpaths: + confpath = os.path.join(path, "conf", var) + if os.path.exists(confpath): + for root, dirs, files in os.walk(confpath): + # get all child files, these are appropriate values + for f in files: + val, sep, end = f.rpartition('.') + if end == 'conf': + possible.append(val) + + bb.event.fire(bb.event.ConfigFilesFound(var, possible), self.configuration.data) + def checkInheritsClass(self, klass): pkg_list = [] + for pfn in self.status.pkg_fn: inherits = self.status.inherits.get(pfn, None) if inherits and inherits.count(klass) > 0: -- cgit v1.2.3-54-g00ecf