summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-08 10:35:16 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-11 17:36:50 +0000
commit43a04ddc7f2727f8ad26860baef49c5ca166c125 (patch)
treeae46bf9014b08fd87c6a7131f63e8cb5de71ccc1 /bitbake
parent8abe4b8b2a215d320e2dd0ee3c8d91d1f5dd5c25 (diff)
downloadpoky-43a04ddc7f2727f8ad26860baef49c5ca166c125.tar.gz
bitbake: ast: Add error when trying to use dash in sh function names
A dash character is illegal in function names in sh (but not bash). Since our shell tasks run under sh and the shell parser is sh based, EXPORT_FUNCTIONS won't work with class names containing a dash. We can't change sh, we can ensure the user is warned about the problem straight away though. [YOCTO #7006] (Bitbake rev: 879fe20f47ba75f4afb3484d4398d5fd60431e12) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/parse/ast.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 4e5a06e761..4b10ee7013 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -226,6 +226,8 @@ class ExportFuncsNode(AstNode):
226 if data.getVarFlag(calledfunc, "python"): 226 if data.getVarFlag(calledfunc, "python"):
227 data.setVar(func, " bb.build.exec_func('" + calledfunc + "', d)\n") 227 data.setVar(func, " bb.build.exec_func('" + calledfunc + "', d)\n")
228 else: 228 else:
229 if "-" in self.classname:
230 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))
229 data.setVar(func, " " + calledfunc + "\n") 231 data.setVar(func, " " + calledfunc + "\n")
230 data.setVarFlag(func, 'export_func', '1') 232 data.setVarFlag(func, 'export_func', '1')
231 233