]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: python funcname can not include special character @
authorLi Wang <li.wang@windriver.com>
Tue, 25 Jun 2013 06:31:14 +0000 (14:31 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 27 Jun 2013 09:00:23 +0000 (10:00 +0100)
[YOCTO #4772]

When path:file change to python function, it maybe include '@' character.
So, add the special character to change to '_' for avoid error.

Signed-off-by: Li Wang <li.wang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/parse/ast.py

index 6e7fd84b16a04e4e6ede1498bf96e9593689c9f6..d4b8b095430898ee7091012b3d374cef6f540d05 100644 (file)
@@ -147,7 +147,7 @@ class MethodNode(AstNode):
     def eval(self, data):
         text = '\n'.join(self.body)
         if self.func_name == "__anonymous":
-            funcname = ("__anon_%s_%s" % (self.lineno, self.filename.translate(string.maketrans('/.+-', '____'))))
+            funcname = ("__anon_%s_%s" % (self.lineno, self.filename.translate(string.maketrans('/.+-@', '_____'))))
             text = "def %s(d):\n" % (funcname) + text
             bb.methodpool.insert_method(funcname, text, self.filename)
             anonfuncs = data.getVar('__BBANONFUNCS') or []