summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/parse_py/BBHandler.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py/BBHandler.py')
-rw-r--r--bitbake/lib/bb/parse/parse_py/BBHandler.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py
index 4d5b45e1ef..cd1c998f8f 100644
--- a/bitbake/lib/bb/parse/parse_py/BBHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -21,6 +21,7 @@ from .ConfHandler import include, init
21 21
22__func_start_regexp__ = re.compile(r"(((?P<py>python(?=(\s|\()))|(?P<fr>fakeroot(?=\s)))\s*)*(?P<func>[\w\.\-\+\{\}\$:]+)?\s*\(\s*\)\s*{$" ) 22__func_start_regexp__ = re.compile(r"(((?P<py>python(?=(\s|\()))|(?P<fr>fakeroot(?=\s)))\s*)*(?P<func>[\w\.\-\+\{\}\$:]+)?\s*\(\s*\)\s*{$" )
23__inherit_regexp__ = re.compile(r"inherit\s+(.+)" ) 23__inherit_regexp__ = re.compile(r"inherit\s+(.+)" )
24__inherit_def_regexp__ = re.compile(r"inherit_defer\s+(.+)" )
24__export_func_regexp__ = re.compile(r"EXPORT_FUNCTIONS\s+(.+)" ) 25__export_func_regexp__ = re.compile(r"EXPORT_FUNCTIONS\s+(.+)" )
25__addtask_regexp__ = re.compile(r"addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*") 26__addtask_regexp__ = re.compile(r"addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*")
26__deltask_regexp__ = re.compile(r"deltask\s+(.+)") 27__deltask_regexp__ = re.compile(r"deltask\s+(.+)")
@@ -40,8 +41,10 @@ def supports(fn, d):
40 """Return True if fn has a supported extension""" 41 """Return True if fn has a supported extension"""
41 return os.path.splitext(fn)[-1] in [".bb", ".bbclass", ".inc"] 42 return os.path.splitext(fn)[-1] in [".bb", ".bbclass", ".inc"]
42 43
43def inherit(files, fn, lineno, d): 44def inherit(files, fn, lineno, d, deferred=False):
44 __inherit_cache = d.getVar('__inherit_cache', False) or [] 45 __inherit_cache = d.getVar('__inherit_cache', False) or []
46 #if "${" in files and not deferred:
47 # bb.warn("%s:%s has non deferred conditional inherit" % (fn, lineno))
45 files = d.expand(files).split() 48 files = d.expand(files).split()
46 for file in files: 49 for file in files:
47 classtype = d.getVar("__bbclasstype", False) 50 classtype = d.getVar("__bbclasstype", False)
@@ -265,6 +268,11 @@ def feeder(lineno, s, fn, root, statements, eof=False):
265 ast.handleInherit(statements, fn, lineno, m) 268 ast.handleInherit(statements, fn, lineno, m)
266 return 269 return
267 270
271 m = __inherit_def_regexp__.match(s)
272 if m:
273 ast.handleInheritDeferred(statements, fn, lineno, m)
274 return
275
268 return ConfHandler.feeder(lineno, s, fn, statements, conffile=False) 276 return ConfHandler.feeder(lineno, s, fn, statements, conffile=False)
269 277
270# Add us to the handlers list 278# Add us to the handlers list