summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-09-07 14:33:53 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-09-07 14:33:53 +0100
commit647713050b091e55497aee5647b6d0d0abc08411 (patch)
treecdade357ee25230407780993eaeaefab58cd402d /bitbake
parent1c24729697a75a7bac325e26b9c1102aa6b08a3d (diff)
downloadpoky-647713050b091e55497aee5647b6d0d0abc08411.tar.gz
bitbake/codeparser: Deal with functions with trailing whitespace
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/codeparser.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py
index 951bd47b88..7d40835cb8 100644
--- a/bitbake/lib/bb/codeparser.py
+++ b/bitbake/lib/bb/codeparser.py
@@ -15,7 +15,14 @@ except ImportError:
15def check_indent(codestr): 15def check_indent(codestr):
16 """If the code is indented, add a top level piece of code to 'remove' the indentation""" 16 """If the code is indented, add a top level piece of code to 'remove' the indentation"""
17 17
18 if codestr[0] is " " or codestr[0] is " ": 18 i = 0
19 while codestr[i] in ["\n", " ", " "]:
20 i = i + 1
21
22 if i == 0:
23 return codestr
24
25 if codestr[i-1] is " " or codestr[i-1] is " ":
19 return "if 1:\n" + codestr 26 return "if 1:\n" + codestr
20 27
21 return codestr 28 return codestr