diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-23 10:49:57 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-24 10:34:52 +0100 |
commit | ea346917910734b6a9e537f83bd26b18cd3bf4f0 (patch) | |
tree | 9dd88d3a824e3480fc754da00e46a36a76cb340d /bitbake/lib/bb/cooker.py | |
parent | b9bd05b6724bb1cfe1a2ebd0610e6e084525eb63 (diff) | |
download | poky-ea346917910734b6a9e537f83bd26b18cd3bf4f0.tar.gz |
bitbake: cooker/cookerdata/utils: Improve context management
The current execution context management for bitbake is ugly and the
use of a global variable is nasty. Fixing that is hard, however we
can improve things to start to establish an API for accessing
and changing that context.
This patch also adds in an explicit reset of the context when we reparse
the configuration data which starts to improve the lifecycle of the data
in setups like hob.
(Bitbake rev: 6c3281a140125337fc75783973485e16785d05a1)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 41f70ab95a..e8686475b9 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -1454,7 +1454,7 @@ class Parser(multiprocessing.Process): | |||
1454 | self.quit = quit | 1454 | self.quit = quit |
1455 | self.init = init | 1455 | self.init = init |
1456 | multiprocessing.Process.__init__(self) | 1456 | multiprocessing.Process.__init__(self) |
1457 | self.context = bb.utils._context.copy() | 1457 | self.context = bb.utils.get_context().copy() |
1458 | self.handlers = bb.event._handlers.copy() | 1458 | self.handlers = bb.event._handlers.copy() |
1459 | 1459 | ||
1460 | def run(self): | 1460 | def run(self): |
@@ -1490,7 +1490,8 @@ class Parser(multiprocessing.Process): | |||
1490 | 1490 | ||
1491 | def parse(self, filename, appends, caches_array): | 1491 | def parse(self, filename, appends, caches_array): |
1492 | try: | 1492 | try: |
1493 | bb.utils._context = self.context.copy() | 1493 | # Reset our environment and handlers to the original settings |
1494 | bb.utils.set_context(self.context.copy()) | ||
1494 | bb.event._handlers = self.handlers.copy() | 1495 | bb.event._handlers = self.handlers.copy() |
1495 | return True, bb.cache.Cache.parse(filename, appends, self.cfg, caches_array) | 1496 | return True, bb.cache.Cache.parse(filename, appends, self.cfg, caches_array) |
1496 | except Exception as exc: | 1497 | except Exception as exc: |