All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cookerdata.py: check for existence of configuration files
@ 2017-01-12 23:40 Juro Bystricky
  2017-01-13 10:54 ` Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Juro Bystricky @ 2017-01-12 23:40 UTC (permalink / raw)
  To: bitbake-devel; +Cc: jurobystricky

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@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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-13 17:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-12 23:40 [PATCH] cookerdata.py: check for existence of configuration files Juro Bystricky
2017-01-13 10:54 ` Richard Purdie
2017-01-13 17:01   ` Bystricky, Juro
2017-01-13 17:06     ` Richard Purdie
2017-01-13 17:08       ` Bystricky, Juro

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.