summaryrefslogtreecommitdiff
path: root/bitbake/lib/bb/cooker.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-12-08 14:30:33 -0500
committerRichard Purdie <rpurdie@linux.intel.com>2011-01-04 14:46:47 +0000
commit825e5045f40185666605392138289448e33ec72d (patch)
tree37ffa7fb4a139f7c6bc7801ed016d66c0aa1ce29 /bitbake/lib/bb/cooker.py
parentac4d926f413b127810130ad7a442e6daf1fdd1b9 (diff)
downloadopenembedded-core-825e5045f40185666605392138289448e33ec72d.tar.gz
openembedded-core-825e5045f40185666605392138289448e33ec72d.tar.bz2
openembedded-core-825e5045f40185666605392138289448e33ec72d.zip
cooker: merge cookerState and cookerAction
(Bitbake rev: c7c8945ef7ca9465312e630b7fa5f0a87ac8b6c7) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r--bitbake/lib/bb/cooker.py33
1 files changed, 11 insertions, 22 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index bf896e9428..9f4afbb59e 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -51,16 +51,8 @@ class NothingToBuild(Exception):
Exception raised when there is nothing to build
"""
-
-# Different states cooker can be in
-cookerClean = 1
-cookerParsing = 2
-cookerParsed = 3
-
-# Different action states the cooker can be in
-cookerRun = 1 # Cooker is running normally
-cookerShutdown = 2 # Active tasks should be brought to a controlled stop
-cookerStop = 3 # Stop, now!
+class state:
+ initial, parsing, running, shutdown, stop = range(5)
#============================================================================#
# BBCooker
@@ -112,8 +104,7 @@ class BBCooker:
termios.tcsetattr(fd, termios.TCSANOW, tcattr)
self.command = bb.command.Command(self)
- self.cookerState = cookerClean
- self.cookerAction = cookerRun
+ self.state = state.initial
def parseConfiguration(self):
@@ -681,9 +672,9 @@ class BBCooker:
def buildFileIdle(server, rq, abort):
- if abort or self.cookerAction == cookerStop:
+ if abort or self.state == state.stop:
rq.finish_runqueue(True)
- elif self.cookerAction == cookerShutdown:
+ elif self.state == state.shutdown:
rq.finish_runqueue(False)
failures = 0
try:
@@ -718,9 +709,9 @@ class BBCooker:
targets = self.checkPackages(targets)
def buildTargetsIdle(server, rq, abort):
- if abort or self.cookerAction == cookerStop:
+ if abort or self.state == state.stop:
rq.finish_runqueue(True)
- elif self.cookerAction == cookerShutdown:
+ elif self.state == state.shutdown:
rq.finish_runqueue(False)
failures = 0
try:
@@ -763,12 +754,10 @@ class BBCooker:
self.server.register_idle_function(buildTargetsIdle, rq)
def updateCache(self):
-
- if self.cookerState == cookerParsed:
+ if self.state == state.running:
return
- if self.cookerState != cookerParsing:
-
+ if self.state != state.parsing:
self.parseConfiguration ()
# Import Psyco if available and not disabled
@@ -798,12 +787,12 @@ class BBCooker:
bb.data.renameVar("__depends", "__base_depends", self.configuration.data)
self.parser = CookerParser(self, filelist, masked)
- self.cookerState = cookerParsing
+ self.state = state.parsing
if not self.parser.parse_next():
collectlog.debug(1, "parsing complete")
self.buildDepgraph()
- self.cookerState = cookerParsed
+ self.state = state.running
return None
return True