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-23 10:57:26 +0100 |
commit | 6c3281a140125337fc75783973485e16785d05a1 (patch) | |
tree | 4be1d109dfe19f8cc29aeb93e9b90e3a4d2aeb51 /lib/bb/cooker.py | |
parent | 3dc83bbb1bf387bb7ecea2e17f0f72cfccecba92 (diff) | |
download | bitbake-6c3281a140125337fc75783973485e16785d05a1.tar.gz |
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cooker.py')
-rw-r--r-- | lib/bb/cooker.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py index 41f70ab95..e8686475b 100644 --- a/lib/bb/cooker.py +++ b/lib/bb/cooker.py @@ -1454,7 +1454,7 @@ class Parser(multiprocessing.Process): self.quit = quit self.init = init multiprocessing.Process.__init__(self) - self.context = bb.utils._context.copy() + self.context = bb.utils.get_context().copy() self.handlers = bb.event._handlers.copy() def run(self): @@ -1490,7 +1490,8 @@ class Parser(multiprocessing.Process): def parse(self, filename, appends, caches_array): try: - bb.utils._context = self.context.copy() + # Reset our environment and handlers to the original settings + bb.utils.set_context(self.context.copy()) bb.event._handlers = self.handlers.copy() return True, bb.cache.Cache.parse(filename, appends, self.cfg, caches_array) except Exception as exc: |