summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/command.py2
-rw-r--r--bitbake/lib/bb/cooker.py10
-rw-r--r--bitbake/lib/bb/cookerdata.py8
-rw-r--r--bitbake/lib/bb/server/process.py3
4 files changed, 9 insertions, 14 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 48a7f1a158..4d152ff4c0 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -84,7 +84,7 @@ class Command:
84 if command not in CommandsAsync.__dict__: 84 if command not in CommandsAsync.__dict__:
85 return None, "No such command" 85 return None, "No such command"
86 self.currentAsyncCommand = (command, commandline) 86 self.currentAsyncCommand = (command, commandline)
87 self.cooker.configuration.server_register_idlecallback(self.cooker.runCommands, self.cooker) 87 self.cooker.idleCallBackRegister(self.cooker.runCommands, self.cooker)
88 return True, None 88 return True, None
89 89
90 def runAsyncCommand(self): 90 def runAsyncCommand(self):
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index f6abc63487..9123605461 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -148,7 +148,7 @@ class BBCooker:
148 Manages one bitbake build run 148 Manages one bitbake build run
149 """ 149 """
150 150
151 def __init__(self, configuration, featureSet=None): 151 def __init__(self, configuration, featureSet=None, idleCallBackRegister=None):
152 self.recipecaches = None 152 self.recipecaches = None
153 self.skiplist = {} 153 self.skiplist = {}
154 self.featureset = CookerFeatures() 154 self.featureset = CookerFeatures()
@@ -158,6 +158,8 @@ class BBCooker:
158 158
159 self.configuration = configuration 159 self.configuration = configuration
160 160
161 self.idleCallBackRegister = idleCallBackRegister
162
161 bb.debug(1, "BBCooker starting %s" % time.time()) 163 bb.debug(1, "BBCooker starting %s" % time.time())
162 sys.stdout.flush() 164 sys.stdout.flush()
163 165
@@ -210,7 +212,7 @@ class BBCooker:
210 cooker.process_inotify_updates() 212 cooker.process_inotify_updates()
211 return 1.0 213 return 1.0
212 214
213 self.configuration.server_register_idlecallback(_process_inotify_updates, self) 215 self.idleCallBackRegister(_process_inotify_updates, self)
214 216
215 # TOSTOP must not be set or our children will hang when they output 217 # TOSTOP must not be set or our children will hang when they output
216 try: 218 try:
@@ -1423,7 +1425,7 @@ class BBCooker:
1423 return True 1425 return True
1424 return retval 1426 return retval
1425 1427
1426 self.configuration.server_register_idlecallback(buildFileIdle, rq) 1428 self.idleCallBackRegister(buildFileIdle, rq)
1427 1429
1428 def buildTargets(self, targets, task): 1430 def buildTargets(self, targets, task):
1429 """ 1431 """
@@ -1494,7 +1496,7 @@ class BBCooker:
1494 if 'universe' in targets: 1496 if 'universe' in targets:
1495 rq.rqdata.warn_multi_bb = True 1497 rq.rqdata.warn_multi_bb = True
1496 1498
1497 self.configuration.server_register_idlecallback(buildTargetsIdle, rq) 1499 self.idleCallBackRegister(buildTargetsIdle, rq)
1498 1500
1499 1501
1500 def getAllKeysWithFlags(self, flaglist): 1502 def getAllKeysWithFlags(self, flaglist):
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index 24bf09c56b..b86e7d446b 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -143,16 +143,10 @@ class CookerConfiguration(object):
143 setattr(self, key, parameters.options.__dict__[key]) 143 setattr(self, key, parameters.options.__dict__[key])
144 self.env = parameters.environment.copy() 144 self.env = parameters.environment.copy()
145 145
146 def setServerRegIdleCallback(self, srcb):
147 self.server_register_idlecallback = srcb
148
149 def __getstate__(self): 146 def __getstate__(self):
150 state = {} 147 state = {}
151 for key in self.__dict__.keys(): 148 for key in self.__dict__.keys():
152 if key == "server_register_idlecallback": 149 state[key] = getattr(self, key)
153 state[key] = None
154 else:
155 state[key] = getattr(self, key)
156 return state 150 return state
157 151
158 def __setstate__(self,state): 152 def __setstate__(self,state):
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index a152b44824..a3ef10753d 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -467,11 +467,10 @@ class BitBakeServer(object):
467 sys.stdout.flush() 467 sys.stdout.flush()
468 468
469 server = ProcessServer(self.bitbake_lock, self.sock, self.sockname) 469 server = ProcessServer(self.bitbake_lock, self.sock, self.sockname)
470 self.configuration.setServerRegIdleCallback(server.register_idle_function)
471 os.close(self.readypipe) 470 os.close(self.readypipe)
472 writer = ConnectionWriter(self.readypipein) 471 writer = ConnectionWriter(self.readypipein)
473 try: 472 try:
474 self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset) 473 self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset, server.register_idle_function)
475 except bb.BBHandledException: 474 except bb.BBHandledException:
476 return None 475 return None
477 writer.send("r") 476 writer.send("r")