summaryrefslogtreecommitdiffstats
path: root/lib/bb/cooker.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-13 17:31:54 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-13 17:45:37 +0100
commit12e9d33bfae5294e3870dfd1202f63383ad05e92 (patch)
treec46577c42d681ebb992192cf9c6bd860b42be185 /lib/bb/cooker.py
parent1193b8d76fcb6cb87e9ec135a2514370d7dd90ac (diff)
downloadbitbake-12e9d33bfae5294e3870dfd1202f63383ad05e92.tar.gz
cooker: Rename confusing 'stop' state to 'forceshutdown'
The shutdown state causes the server to finish what its doing, stop was them meant to completely stop it. It doesn't mean the server is stopped though. Renaming the current stop event for forceshutdown gives more meaning to what it actually does. The stopped namespace then becomes available to indicate a completely stopped server. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cooker.py')
-rw-r--r--lib/bb/cooker.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 7034f1d71..4b2e5bf91 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -61,7 +61,7 @@ class CollectionError(bb.BBHandledException):
"""
class state:
- initial, parsing, running, shutdown, stop = range(5)
+ initial, parsing, running, shutdown, forceshutdown, stopped = range(6)
class SkippedPackage:
@@ -1044,7 +1044,7 @@ class BBCooker:
def buildFileIdle(server, rq, abort):
- if abort or self.state == state.stop:
+ if abort or self.state == state.forceshutdown:
rq.finish_runqueue(True)
elif self.state == state.shutdown:
rq.finish_runqueue(False)
@@ -1081,7 +1081,7 @@ class BBCooker:
targets = self.checkPackages(targets)
def buildTargetsIdle(server, rq, abort):
- if abort or self.state == state.stop:
+ if abort or self.state == state.forceshutdown:
rq.finish_runqueue(True)
elif self.state == state.shutdown:
rq.finish_runqueue(False)
@@ -1170,7 +1170,7 @@ class BBCooker:
if self.state == state.running:
return
- if self.state in (state.shutdown, state.stop):
+ if self.state in (state.shutdown, state.forceshutdown):
self.parser.shutdown(clean=False, force = True)
sys.exit(1)
@@ -1240,11 +1240,11 @@ class BBCooker:
prserv.serv.auto_shutdown(self.data)
bb.event.fire(CookerExit(), self.event_data)
- def shutdown(self):
- self.state = state.shutdown
-
- def stop(self):
- self.state = state.stop
+ def shutdown(self, force = False):
+ if force:
+ self.state = state.forceshutdown
+ else:
+ self.state = state.shutdown
def initialize(self):
self.initConfigurationData()