[bitbake-devel] [PATCH 1/2] ConfHandler.py: allow inherit or include without parameter

Patrick Ohly patrick.ohly at intel.com
Wed Jun 7 13:56:24 UTC 2017


Writing .bbappends that only have an effect when some configuration
variable like DISTRO_FEATURES is changed becomes easier when allowing
"inherit" or "require" without a parameter. The same was already
allowed for "inherit".

Then one can write in a .bbappend:

  require ${@bb.utils.contains('DISTRO_FEATURES', 'foo', 'bar.inc', '', d)}

Signed-off-by: Patrick Ohly <patrick.ohly at intel.com>
---
 lib/bb/parse/parse_py/ConfHandler.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/bb/parse/parse_py/ConfHandler.py b/lib/bb/parse/parse_py/ConfHandler.py
index bf7e985..b006d06 100644
--- a/lib/bb/parse/parse_py/ConfHandler.py
+++ b/lib/bb/parse/parse_py/ConfHandler.py
@@ -81,6 +81,10 @@ def include(parentfn, fn, lineno, data, error_out):
     fn = data.expand(fn)
     parentfn = data.expand(parentfn)
 
+    if not fn:
+        # "include" or "require" without parameter is fine, just return.
+        return
+
     if not os.path.isabs(fn):
         dname = os.path.dirname(parentfn)
         bbpath = "%s:%s" % (dname, data.getVar("BBPATH"))
-- 
git-series 0.9.1



More information about the bitbake-devel mailing list