diff options
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py')
-rw-r--r-- | bitbake/lib/bb/parse/parse_py/BBHandler.py | 10 |
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 | ||
43 | def inherit(files, fn, lineno, d): | 44 | def 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 |