summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/ast.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/parse/ast.py')
-rw-r--r--bitbake/lib/bb/parse/ast.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 6441c5cf7c..d30b688965 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -211,10 +211,12 @@ class ExportFuncsNode(AstNode):
211 211
212 def eval(self, data): 212 def eval(self, data):
213 213
214 sentinel = " # Export function set\n"
214 for func in self.n: 215 for func in self.n:
215 calledfunc = self.classname + "_" + func 216 calledfunc = self.classname + "_" + func
216 217
217 if data.getVar(func, False) and not data.getVarFlag(func, 'export_func', False): 218 basevar = data.getVar(func, False)
219 if basevar and sentinel not in basevar:
218 continue 220 continue
219 221
220 if data.getVar(func, False): 222 if data.getVar(func, False):
@@ -231,12 +233,11 @@ class ExportFuncsNode(AstNode):
231 data.setVarFlag(func, "lineno", 1) 233 data.setVarFlag(func, "lineno", 1)
232 234
233 if data.getVarFlag(calledfunc, "python", False): 235 if data.getVarFlag(calledfunc, "python", False):
234 data.setVar(func, " bb.build.exec_func('" + calledfunc + "', d)\n", parsing=True) 236 data.setVar(func, sentinel + " bb.build.exec_func('" + calledfunc + "', d)\n", parsing=True)
235 else: 237 else:
236 if "-" in self.classname: 238 if "-" in self.classname:
237 bb.fatal("The classname %s contains a dash character and is calling an sh function %s using EXPORT_FUNCTIONS. Since a dash is illegal in sh function names, this cannot work, please rename the class or don't use EXPORT_FUNCTIONS." % (self.classname, calledfunc)) 239 bb.fatal("The classname %s contains a dash character and is calling an sh function %s using EXPORT_FUNCTIONS. Since a dash is illegal in sh function names, this cannot work, please rename the class or don't use EXPORT_FUNCTIONS." % (self.classname, calledfunc))
238 data.setVar(func, " " + calledfunc + "\n", parsing=True) 240 data.setVar(func, sentinel + " " + calledfunc + "\n", parsing=True)
239 data.setVarFlag(func, 'export_func', '1')
240 241
241class AddTaskNode(AstNode): 242class AddTaskNode(AstNode):
242 def __init__(self, filename, lineno, func, before, after): 243 def __init__(self, filename, lineno, func, before, after):