aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/parse/ast.py
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-01-08 10:37:06 +0000
commit86704281b79e524dccccc88cbf996b299b33bae2 (patch)
tree91100c4beb155f5b166b361f64e07d3cc08786d6 /lib/bb/parse/ast.py
parent6c0706a28d72c591f1b75b6e3f3b645859387c7e (diff)
downloadbitbake-86704281b79e524dccccc88cbf996b299b33bae2.tar.gz
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] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/parse/ast.py')
-rw-r--r--lib/bb/parse/ast.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py
index af42a0c0d..879c9d28f 100644
--- a/lib/bb/parse/ast.py
+++ b/lib/bb/parse/ast.py
@@ -226,6 +226,8 @@ class ExportFuncsNode(AstNode):
if data.getVarFlag(calledfunc, "python"):
data.setVar(func, " bb.build.exec_func('" + calledfunc + "', d)\n")
else:
+ if "-" in self.classname:
+ 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))
data.setVar(func, " " + calledfunc + "\n")
data.setVarFlag(func, 'export_func', '1')