diff options
author | Joshua Lock <josh@linux.intel.com> | 2011-01-04 20:28:20 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-24 15:54:51 +0000 |
commit | 3939a216a53f58831e640e85ed95f7edff3ca76f (patch) | |
tree | 897568c0cd94bc1c624a5480644387eab0213b18 /bitbake/lib/bb/cooker.py | |
parent | 1b3eb0c35f504e8f652303a4b238034ecc5c5d02 (diff) | |
download | poky-3939a216a53f58831e640e85ed95f7edff3ca76f.tar.gz |
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 <josh@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 24 |
1 files changed, 24 insertions, 0 deletions
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: | |||
430 | if not regex in matched: | 430 | if not regex in matched: |
431 | collectlog.warn("No bb files matched BBFILE_PATTERN_%s '%s'" % (collection, pattern)) | 431 | collectlog.warn("No bb files matched BBFILE_PATTERN_%s '%s'" % (collection, pattern)) |
432 | 432 | ||
433 | def findConfigFiles(self, varname): | ||
434 | """ | ||
435 | Find config files which are appropriate values for varname. | ||
436 | i.e. MACHINE, DISTRO | ||
437 | """ | ||
438 | possible = [] | ||
439 | var = varname.lower() | ||
440 | |||
441 | data = self.configuration.data | ||
442 | # iterate configs | ||
443 | bbpaths = bb.data.getVar('BBPATH', data, True).split(':') | ||
444 | for path in bbpaths: | ||
445 | confpath = os.path.join(path, "conf", var) | ||
446 | if os.path.exists(confpath): | ||
447 | for root, dirs, files in os.walk(confpath): | ||
448 | # get all child files, these are appropriate values | ||
449 | for f in files: | ||
450 | val, sep, end = f.rpartition('.') | ||
451 | if end == 'conf': | ||
452 | possible.append(val) | ||
453 | |||
454 | bb.event.fire(bb.event.ConfigFilesFound(var, possible), self.configuration.data) | ||
455 | |||
433 | def checkInheritsClass(self, klass): | 456 | def checkInheritsClass(self, klass): |
434 | pkg_list = [] | 457 | pkg_list = [] |
458 | |||
435 | for pfn in self.status.pkg_fn: | 459 | for pfn in self.status.pkg_fn: |
436 | inherits = self.status.inherits.get(pfn, None) | 460 | inherits = self.status.inherits.get(pfn, None) |
437 | if inherits and inherits.count(klass) > 0: | 461 | if inherits and inherits.count(klass) > 0: |