summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2006-03-22 16:03:39 +0000
committerHolger Hans Peter Freyther <zecke@selfish.org>2006-03-22 16:03:39 +0000
commit2658d3c95d43dfcff95a6cd7285f3966dfa5bb2e (patch)
tree65716f18f61c817cbcdef58a9bbb95de8101ced4
parentd278633c0bebe89ab2490856f57540fe263bb545 (diff)
downloadbitbake-2658d3c95d43dfcff95a6cd7285f3966dfa5bb2e.tar.gz
lib/bb/data_smart.py:
ReAdd the handlers when unpickling the file parse/parse_py/BBHandler.py: Save the once added handlers in the bitbake file.
-rw-r--r--lib/bb/data_smart.py9
-rw-r--r--lib/bb/parse/parse_py/BBHandler.py13
2 files changed, 21 insertions, 1 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 52f391dec..93a6acfc9 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -285,11 +285,20 @@ class DataSmartPackage(DataSmart):
p = pickle.Unpickler( file("%s/%s"%(self.cache,cache_bbfile),"rb"))
self.dict = p.load()
self.unpickle_prep()
+
+ # compile the functions into global scope
funcstr = self.getVar('__functions__', 0)
if funcstr:
comp = utils.better_compile(funcstr, "<pickled>", self.bbfile)
utils.better_exec(comp, __builtins__, funcstr, self.bbfile)
+ # now add the handlers which were present
+ handlers = self.getVar('__all_handlers__', 0) or {}
+ import bb.event
+ for key in handlers.keys():
+ bb.event.register(key, handlers[key])
+
+
def linkDataSet(self):
if not self.parent == None:
# assume parent is a DataSmartInstance
diff --git a/lib/bb/parse/parse_py/BBHandler.py b/lib/bb/parse/parse_py/BBHandler.py
index 92ff6c5b7..a1bf9800a 100644
--- a/lib/bb/parse/parse_py/BBHandler.py
+++ b/lib/bb/parse/parse_py/BBHandler.py
@@ -165,9 +165,15 @@ def handle(fn, d, include = 0):
set_additional_vars(fn, d, include)
data.update_data(d)
+ all_handlers = {}
for var in data.keys(d):
+ # try to add the handler
+ # if we added it remember the choiche
if data.getVarFlag(var, 'handler', d):
- bb.event.register(var, data.getVar(var, d))
+ handler = data.getVar(var,d)
+ if bb.event.register(var,handler) == bb.event.Registered:
+ all_handlers[var] = handler
+
continue
if not data.getVarFlag(var, 'task', d):
@@ -181,6 +187,11 @@ def handle(fn, d, include = 0):
pdeps.append(var)
data.setVarFlag(p, 'deps', pdeps, d)
bb.build.add_task(p, pdeps, d)
+
+ # now add the handlers
+ if not len(all_handlers) == 0:
+ data.setVar('__all_handlers__', all_handlers, d)
+
bbpath.pop(0)
if oldfile:
bb.data.setVar("FILE", oldfile, d)