diff options
| -rw-r--r-- | bitbake/lib/bb/parse/parse_py/BBHandler.py | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index f313009ab8..9b8ad0b9ec 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py | |||
| @@ -78,6 +78,22 @@ def inherit(files, d): | |||
| 78 | include(fn, file, d, "inherit") | 78 | include(fn, file, d, "inherit") |
| 79 | __inherit_cache = data.getVar('__inherit_cache', d) or [] | 79 | __inherit_cache = data.getVar('__inherit_cache', d) or [] |
| 80 | 80 | ||
| 81 | def get_statements(filename, absolsute_filename, base_name, file): | ||
| 82 | statements = ast.StatementGroup() | ||
| 83 | |||
| 84 | lineno = 0 | ||
| 85 | while 1: | ||
| 86 | lineno = lineno + 1 | ||
| 87 | s = file.readline() | ||
| 88 | if not s: break | ||
| 89 | s = s.rstrip() | ||
| 90 | feeder(lineno, s, filename, base_name, statements) | ||
| 91 | if __inpython__: | ||
| 92 | # add a blank line to close out any python definition | ||
| 93 | feeder(IN_PYTHON_EOF, "", filename, base_name, statements) | ||
| 94 | |||
| 95 | return statements | ||
| 96 | |||
| 81 | def handle(fn, d, include): | 97 | def handle(fn, d, include): |
| 82 | global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __infunc__, __body__, __residue__ | 98 | global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __infunc__, __body__, __residue__ |
| 83 | __body__ = [] | 99 | __body__ = [] |
| @@ -113,17 +129,8 @@ def handle(fn, d, include): | |||
| 113 | if include: | 129 | if include: |
| 114 | bb.parse.mark_dependency(d, abs_fn) | 130 | bb.parse.mark_dependency(d, abs_fn) |
| 115 | 131 | ||
| 116 | statements = ast.StatementGroup() | 132 | # actual loading |
| 117 | lineno = 0 | 133 | statements = get_statements(fn, abs_fn, base_name, f) |
| 118 | while 1: | ||
| 119 | lineno = lineno + 1 | ||
| 120 | s = f.readline() | ||
| 121 | if not s: break | ||
| 122 | s = s.rstrip() | ||
| 123 | feeder(lineno, s, fn, base_name, statements) | ||
| 124 | if __inpython__: | ||
| 125 | # add a blank line to close out any python definition | ||
| 126 | feeder(IN_PYTHON_EOF, "", fn, base_name, statements) | ||
| 127 | 134 | ||
| 128 | # DONE WITH PARSING... time to evaluate | 135 | # DONE WITH PARSING... time to evaluate |
| 129 | if ext != ".bbclass": | 136 | if ext != ".bbclass": |
