[bitbake-devel] [PATCH] cookerdata.py: check for existence of configuration files

Juro Bystricky juro.bystricky at intel.com
Thu Jan 12 23:40:31 UTC 2017


Presently there is no check to verify the existence of configuration
files as listed in BBMULTICONFIG. For example, BBMULTICONFIG = "foobar" in local.conf
does not trigger an error when there is no conf/multiconfig/foobar.conf.
The missing file is silently ignored.

This patch verifies the existence of config files and errors-out with the message:

ERROR: BBMULTICONFIG="foobar" but the configuration file './conf/multiconfig/foobar.conf' does not exist!

when the file does not exist.

[YOCTO#10917]

Signed-off-by: Juro Bystricky <juro.bystricky at intel.com>
---
 bitbake/lib/bb/cookerdata.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index d9eab56..bb1e2c3 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -289,6 +289,12 @@ class CookerDataBuilder(object):
 
             multiconfig = (self.data.getVar("BBMULTICONFIG") or "").split()
             for config in multiconfig:
+                if config != "":
+                    src = "./conf/multiconfig/" + config + ".conf"
+                    if not os.access(src, os.R_OK):
+                        parselog.critical("BBMULTICONFIG=\"%s\" but the configuration file '%s' does not exist! " % (self.data.getVar("BBMULTICONFIG"),src))
+                        sys.exit(1)
+
                 mcdata = self.parseConfigurationFiles(self.prefiles, self.postfiles, config)
                 bb.event.fire(bb.event.ConfigParsed(), mcdata)
                 self.mcdata[config] = mcdata
-- 
2.7.4




More information about the bitbake-devel mailing list