diff options
Diffstat (limited to 'bitbake/lib/bb/build.py')
| -rw-r--r-- | bitbake/lib/bb/build.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 599b45d9d3..b59473bc23 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
| @@ -25,7 +25,7 @@ You should have received a copy of the GNU General Public License along with | |||
| 25 | Based on functions from the base bb module, Copyright 2003 Holger Schurig | 25 | Based on functions from the base bb module, Copyright 2003 Holger Schurig |
| 26 | """ | 26 | """ |
| 27 | 27 | ||
| 28 | from bb import debug, data, fetch, fatal, error, note, event, mkdirhier | 28 | from bb import debug, data, fetch, fatal, error, note, event, mkdirhier, utils |
| 29 | import bb, os | 29 | import bb, os |
| 30 | 30 | ||
| 31 | # data holds flags and function name for a given task | 31 | # data holds flags and function name for a given task |
| @@ -122,14 +122,15 @@ def exec_func_python(func, d): | |||
| 122 | """Execute a python BB 'function'""" | 122 | """Execute a python BB 'function'""" |
| 123 | import re, os | 123 | import re, os |
| 124 | 124 | ||
| 125 | tmp = "def " + func + "():\n%s" % data.getVar(func, d) | 125 | tmp = "def " + func + "():\n%s" % data.getVar(func, d) |
| 126 | comp = compile(tmp + '\n' + func + '()', bb.data.getVar('FILE', d, 1) + ':' + func, "exec") | 126 | tmp += '\n' + func + '()' |
| 127 | comp = utils.better_compile(tmp, func, bb.data.getVar('FILE', d, 1) ) | ||
| 127 | prevdir = os.getcwd() | 128 | prevdir = os.getcwd() |
| 128 | g = {} # globals | 129 | g = {} # globals |
| 129 | g['bb'] = bb | 130 | g['bb'] = bb |
| 130 | g['os'] = os | 131 | g['os'] = os |
| 131 | g['d'] = d | 132 | g['d'] = d |
| 132 | exec comp in g | 133 | utils.better_exec(comp,g,tmp, bb.data.getVar('FILE',d,1)) |
| 133 | if os.path.exists(prevdir): | 134 | if os.path.exists(prevdir): |
| 134 | os.chdir(prevdir) | 135 | os.chdir(prevdir) |
| 135 | 136 | ||
