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.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py
index 2e0647b5df..92c55f531a 100644
--- a/bitbake/lib/bb/parse/parse_py/BBHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -51,7 +51,6 @@ __infunc__ = ""
51__inpython__ = False 51__inpython__ = False
52__body__ = [] 52__body__ = []
53__classname__ = "" 53__classname__ = ""
54classes = [ None, ]
55 54
56cached_statements = {} 55cached_statements = {}
57 56
@@ -107,7 +106,7 @@ def get_statements(filename, absolute_filename, base_name):
107 return statements 106 return statements
108 107
109def handle(fn, d, include): 108def handle(fn, d, include):
110 global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __infunc__, __body__, __residue__ 109 global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __infunc__, __body__, __residue__, __classname__
111 __body__ = [] 110 __body__ = []
112 __infunc__ = "" 111 __infunc__ = ""
113 __classname__ = "" 112 __classname__ = ""
@@ -125,7 +124,6 @@ def handle(fn, d, include):
125 124
126 if ext == ".bbclass": 125 if ext == ".bbclass":
127 __classname__ = root 126 __classname__ = root
128 classes.append(__classname__)
129 __inherit_cache = d.getVar('__inherit_cache') or [] 127 __inherit_cache = d.getVar('__inherit_cache') or []
130 if not fn in __inherit_cache: 128 if not fn in __inherit_cache:
131 __inherit_cache.append(fn) 129 __inherit_cache.append(fn)
@@ -150,11 +148,8 @@ def handle(fn, d, include):
150 148
151 statements.eval(d) 149 statements.eval(d)
152 150
153 if ext == ".bbclass": 151 if ext != ".bbclass" and include == 0:
154 classes.remove(__classname__) 152 return ast.multi_finalize(fn, d)
155 else:
156 if include == 0:
157 return ast.multi_finalize(fn, d)
158 153
159 if oldfile: 154 if oldfile:
160 d.setVar("FILE", oldfile) 155 d.setVar("FILE", oldfile)
@@ -166,7 +161,7 @@ def handle(fn, d, include):
166 return d 161 return d
167 162
168def feeder(lineno, s, fn, root, statements): 163def feeder(lineno, s, fn, root, statements):
169 global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __def_regexp__, __python_func_regexp__, __inpython__, __infunc__, __body__, classes, bb, __residue__ 164 global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __def_regexp__, __python_func_regexp__, __inpython__, __infunc__, __body__, bb, __residue__, __classname__
170 if __infunc__: 165 if __infunc__:
171 if s == '}': 166 if s == '}':
172 __body__.append('') 167 __body__.append('')
@@ -225,7 +220,7 @@ def feeder(lineno, s, fn, root, statements):
225 220
226 m = __export_func_regexp__.match(s) 221 m = __export_func_regexp__.match(s)
227 if m: 222 if m:
228 ast.handleExportFuncs(statements, fn, lineno, m, classes) 223 ast.handleExportFuncs(statements, fn, lineno, m, __classname__)
229 return 224 return
230 225
231 m = __addtask_regexp__.match(s) 226 m = __addtask_regexp__.match(s)