From: Li Wang Date: Tue, 25 Jun 2013 06:31:14 +0000 (+0800) Subject: bitbake: python funcname can not include special character @ X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=684bc6dcb11ecb1fd7a4d25c08909ad9879e8342;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git bitbake: python funcname can not include special character @ [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 Signed-off-by: Richard Purdie --- diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py index 6e7fd84b16a..d4b8b095430 100644 --- a/lib/bb/parse/ast.py +++ b/lib/bb/parse/ast.py @@ -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 []