[oe-commits] [bitbake] 01/02: parse/ast: Abstract anonymous function execution into a function
git at git.openembedded.org
git at git.openembedded.org
Sat Mar 3 09:13:39 UTC 2018
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository bitbake.
commit c6be487f9bd5d95915f2495d555b9f539adb1d44
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Fri Mar 2 18:16:33 2018 +0000
parse/ast: Abstract anonymous function execution into a function
This allows us to call this code from other contexts without
duplicating it.
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/parse/ast.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py
index dba4540..6690dc5 100644
--- a/lib/bb/parse/ast.py
+++ b/lib/bb/parse/ast.py
@@ -335,6 +335,12 @@ def handleInherit(statements, filename, lineno, m):
classes = m.group(1)
statements.append(InheritNode(filename, lineno, classes))
+def runAnonFuncs(d):
+ code = []
+ for funcname in d.getVar("__BBANONFUNCS", False) or []:
+ code.append("%s(d)" % funcname)
+ bb.utils.better_exec("\n".join(code), {"d": d})
+
def finalize(fn, d, variant = None):
saved_handlers = bb.event.get_handlers().copy()
@@ -349,10 +355,7 @@ def finalize(fn, d, variant = None):
bb.event.fire(bb.event.RecipePreFinalise(fn), d)
bb.data.expandKeys(d)
- code = []
- for funcname in d.getVar("__BBANONFUNCS", False) or []:
- code.append("%s(d)" % funcname)
- bb.utils.better_exec("\n".join(code), {"d": d})
+ runAnonFuncs(d)
tasklist = d.getVar('__BBTASKS', False) or []
bb.event.fire(bb.event.RecipeTaskPreProcess(fn, list(tasklist)), d)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list