summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/command.py6
-rw-r--r--bitbake/lib/bb/cooker.py18
-rw-r--r--bitbake/lib/bb/server/process.py2
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobeventhandler.py4
-rw-r--r--bitbake/lib/bb/ui/depexp.py2
-rw-r--r--bitbake/lib/bb/ui/goggle.py2
-rw-r--r--bitbake/lib/bb/ui/knotty.py2
-rw-r--r--bitbake/lib/bb/ui/ncurses.py2
8 files changed, 19 insertions, 19 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 3527ad03c1..641cc70619 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -137,13 +137,13 @@ class CommandsSync:
137 """ 137 """
138 Trigger cooker 'shutdown' mode 138 Trigger cooker 'shutdown' mode
139 """ 139 """
140 command.cooker.shutdown() 140 command.cooker.shutdown(False)
141 141
142 def stateStop(self, command, params): 142 def stateForceShutdown(self, command, params):
143 """ 143 """
144 Stop the cooker 144 Stop the cooker
145 """ 145 """
146 command.cooker.stop() 146 command.cooker.shutdown(True)
147 147
148 def getVariable(self, command, params): 148 def getVariable(self, command, params):
149 """ 149 """
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 7034f1d718..4b2e5bf917 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -61,7 +61,7 @@ class CollectionError(bb.BBHandledException):
61 """ 61 """
62 62
63class state: 63class state:
64 initial, parsing, running, shutdown, stop = range(5) 64 initial, parsing, running, shutdown, forceshutdown, stopped = range(6)
65 65
66 66
67class SkippedPackage: 67class SkippedPackage:
@@ -1044,7 +1044,7 @@ class BBCooker:
1044 1044
1045 def buildFileIdle(server, rq, abort): 1045 def buildFileIdle(server, rq, abort):
1046 1046
1047 if abort or self.state == state.stop: 1047 if abort or self.state == state.forceshutdown:
1048 rq.finish_runqueue(True) 1048 rq.finish_runqueue(True)
1049 elif self.state == state.shutdown: 1049 elif self.state == state.shutdown:
1050 rq.finish_runqueue(False) 1050 rq.finish_runqueue(False)
@@ -1081,7 +1081,7 @@ class BBCooker:
1081 targets = self.checkPackages(targets) 1081 targets = self.checkPackages(targets)
1082 1082
1083 def buildTargetsIdle(server, rq, abort): 1083 def buildTargetsIdle(server, rq, abort):
1084 if abort or self.state == state.stop: 1084 if abort or self.state == state.forceshutdown:
1085 rq.finish_runqueue(True) 1085 rq.finish_runqueue(True)
1086 elif self.state == state.shutdown: 1086 elif self.state == state.shutdown:
1087 rq.finish_runqueue(False) 1087 rq.finish_runqueue(False)
@@ -1170,7 +1170,7 @@ class BBCooker:
1170 if self.state == state.running: 1170 if self.state == state.running:
1171 return 1171 return
1172 1172
1173 if self.state in (state.shutdown, state.stop): 1173 if self.state in (state.shutdown, state.forceshutdown):
1174 self.parser.shutdown(clean=False, force = True) 1174 self.parser.shutdown(clean=False, force = True)
1175 sys.exit(1) 1175 sys.exit(1)
1176 1176
@@ -1240,11 +1240,11 @@ class BBCooker:
1240 prserv.serv.auto_shutdown(self.data) 1240 prserv.serv.auto_shutdown(self.data)
1241 bb.event.fire(CookerExit(), self.event_data) 1241 bb.event.fire(CookerExit(), self.event_data)
1242 1242
1243 def shutdown(self): 1243 def shutdown(self, force = False):
1244 self.state = state.shutdown 1244 if force:
1245 1245 self.state = state.forceshutdown
1246 def stop(self): 1246 else:
1247 self.state = state.stop 1247 self.state = state.shutdown
1248 1248
1249 def initialize(self): 1249 def initialize(self):
1250 self.initConfigurationData() 1250 self.initConfigurationData()
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index c0af052ebd..e45e0c2f6d 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -113,7 +113,7 @@ class ProcessServer(Process, BaseImplServer):
113 self.event_queue.close() 113 self.event_queue.close()
114 bb.event.unregister_UIHhandler(self.event_handle.value) 114 bb.event.unregister_UIHhandler(self.event_handle.value)
115 self.command_channel.close() 115 self.command_channel.close()
116 self.cooker.stop() 116 self.cooker.shutdown(True)
117 self.idle_commands(.1) 117 self.idle_commands(.1)
118 118
119 def idle_commands(self, delay, fds = []): 119 def idle_commands(self, delay, fds = []):
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index d0ac6bd677..ef74e563f9 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -440,12 +440,12 @@ class HobHandler(gobject.GObject):
440 self.building = False 440 self.building = False
441 441
442 def cancel_parse(self): 442 def cancel_parse(self):
443 self.runCommand(["stateStop"]) 443 self.runCommand(["stateForceShutdown"])
444 444
445 def cancel_build(self, force=False): 445 def cancel_build(self, force=False):
446 if force: 446 if force:
447 # Force the cooker to stop as quickly as possible 447 # Force the cooker to stop as quickly as possible
448 self.runCommand(["stateStop"]) 448 self.runCommand(["stateForceShutdown"])
449 else: 449 else:
450 # Wait for tasks to complete before shutting down, this helps 450 # Wait for tasks to complete before shutting down, this helps
451 # leave the workdir in a usable state 451 # leave the workdir in a usable state
diff --git a/bitbake/lib/bb/ui/depexp.py b/bitbake/lib/bb/ui/depexp.py
index cbda6d5afe..0b160e2f4e 100644
--- a/bitbake/lib/bb/ui/depexp.py
+++ b/bitbake/lib/bb/ui/depexp.py
@@ -314,7 +314,7 @@ def main(server, eventHandler, params):
314 break 314 break
315 if shutdown == 1: 315 if shutdown == 1:
316 print("\nSecond Keyboard Interrupt, stopping...\n") 316 print("\nSecond Keyboard Interrupt, stopping...\n")
317 _, error = server.runCommand(["stateStop"]) 317 _, error = server.runCommand(["stateForceShutdown"])
318 if error: 318 if error:
319 print('Unable to cleanly stop: %s' % error) 319 print('Unable to cleanly stop: %s' % error)
320 if shutdown == 0: 320 if shutdown == 0:
diff --git a/bitbake/lib/bb/ui/goggle.py b/bitbake/lib/bb/ui/goggle.py
index 16faba4c21..f4ee7b41ae 100644
--- a/bitbake/lib/bb/ui/goggle.py
+++ b/bitbake/lib/bb/ui/goggle.py
@@ -117,5 +117,5 @@ def main (server, eventHandler, params):
117 except KeyboardInterrupt: 117 except KeyboardInterrupt:
118 pass 118 pass
119 finally: 119 finally:
120 server.runCommand(["stateStop"]) 120 server.runCommand(["stateForceShutdown"])
121 121
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 45200460b1..f706b9759d 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -499,7 +499,7 @@ def main(server, eventHandler, params, tf = TerminalFilter):
499 main.shutdown = 2 499 main.shutdown = 2
500 if not params.observe_only and main.shutdown == 1: 500 if not params.observe_only and main.shutdown == 1:
501 print("\nSecond Keyboard Interrupt, stopping...\n") 501 print("\nSecond Keyboard Interrupt, stopping...\n")
502 _, error = server.runCommand(["stateStop"]) 502 _, error = server.runCommand(["stateForceShutdown"])
503 if error: 503 if error:
504 logger.error("Unable to cleanly stop: %s" % error) 504 logger.error("Unable to cleanly stop: %s" % error)
505 if not params.observe_only and main.shutdown == 0: 505 if not params.observe_only and main.shutdown == 0:
diff --git a/bitbake/lib/bb/ui/ncurses.py b/bitbake/lib/bb/ui/ncurses.py
index c45ffd63ac..b6c20ec388 100644
--- a/bitbake/lib/bb/ui/ncurses.py
+++ b/bitbake/lib/bb/ui/ncurses.py
@@ -350,7 +350,7 @@ class NCursesUI:
350 exitflag = True 350 exitflag = True
351 if shutdown == 1: 351 if shutdown == 1:
352 mw.appendText("Second Keyboard Interrupt, stopping...\n") 352 mw.appendText("Second Keyboard Interrupt, stopping...\n")
353 _, error = server.runCommand(["stateStop"]) 353 _, error = server.runCommand(["stateForceShutdown"])
354 if error: 354 if error:
355 print("Unable to cleanly stop: %s" % error) 355 print("Unable to cleanly stop: %s" % error)
356 if shutdown == 0: 356 if shutdown == 0: