summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/server/process.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/server/process.py')
-rw-r--r--bitbake/lib/bb/server/process.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index e45e0c2f6d..aa072020af 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -31,7 +31,7 @@ import sys
31import time 31import time
32import select 32import select
33from Queue import Empty 33from Queue import Empty
34from multiprocessing import Event, Process, util, Queue, Pipe, queues 34from multiprocessing import Event, Process, util, Queue, Pipe, queues, Manager
35 35
36from . import BitBakeBaseServer, BitBakeBaseServerConnection, BaseImplServer 36from . import BitBakeBaseServer, BitBakeBaseServerConnection, BaseImplServer
37 37
@@ -78,12 +78,13 @@ class ProcessServer(Process, BaseImplServer):
78 profile_filename = "profile.log" 78 profile_filename = "profile.log"
79 profile_processed_filename = "profile.log.processed" 79 profile_processed_filename = "profile.log.processed"
80 80
81 def __init__(self, command_channel, event_queue): 81 def __init__(self, command_channel, event_queue, featurelist):
82 BaseImplServer.__init__(self) 82 BaseImplServer.__init__(self)
83 Process.__init__(self) 83 Process.__init__(self, args=(featurelist))
84 self.command_channel = command_channel 84 self.command_channel = command_channel
85 self.event_queue = event_queue 85 self.event_queue = event_queue
86 self.event = EventAdapter(event_queue) 86 self.event = EventAdapter(event_queue)
87 self.featurelist = featurelist
87 self.quit = False 88 self.quit = False
88 89
89 self.keep_running = Event() 90 self.keep_running = Event()
@@ -94,6 +95,14 @@ class ProcessServer(Process, BaseImplServer):
94 for event in bb.event.ui_queue: 95 for event in bb.event.ui_queue:
95 self.event_queue.put(event) 96 self.event_queue.put(event)
96 self.event_handle.value = bb.event.register_UIHhandler(self) 97 self.event_handle.value = bb.event.register_UIHhandler(self)
98
99 # process any feature changes based on what UI requested
100 original_featureset = list(self.cooker.featureset)
101 while len(self.featurelist)> 0:
102 self.cooker.featureset.setFeature(self.featurelist.pop())
103 if (original_featureset != list(self.cooker.featureset)):
104 self.cooker.reset()
105
97 bb.cooker.server_main(self.cooker, self.main) 106 bb.cooker.server_main(self.cooker, self.main)
98 107
99 def main(self): 108 def main(self):
@@ -198,13 +207,17 @@ class BitBakeServer(BitBakeBaseServer):
198 # 207 #
199 self.ui_channel, self.server_channel = Pipe() 208 self.ui_channel, self.server_channel = Pipe()
200 self.event_queue = ProcessEventQueue(0) 209 self.event_queue = ProcessEventQueue(0)
201 self.serverImpl = ProcessServer(self.server_channel, self.event_queue) 210 manager = Manager()
211 self.featurelist = manager.list()
212 self.serverImpl = ProcessServer(self.server_channel, self.event_queue, self.featurelist)
202 213
203 def detach(self): 214 def detach(self):
204 self.serverImpl.start() 215 self.serverImpl.start()
205 return 216 return
206 217
207 def establishConnection(self): 218 def establishConnection(self, featureset):
219 for f in featureset:
220 self.featurelist.append(f)
208 self.connection = BitBakeProcessServerConnection(self.serverImpl, self.ui_channel, self.event_queue) 221 self.connection = BitBakeProcessServerConnection(self.serverImpl, self.ui_channel, self.event_queue)
209 signal.signal(signal.SIGTERM, lambda i, s: self.connection.terminate()) 222 signal.signal(signal.SIGTERM, lambda i, s: self.connection.terminate())
210 return self.connection 223 return self.connection