summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-08-09 18:27:51 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-12 21:06:59 +0100
commit19265918768e49d465352c36be1ae9ea21f4b5b2 (patch)
tree192aaaff19ff6a526d991973210da040646f7b62 /bitbake
parent57fd78eae956d97f58e493c3f2404088cc0a7dd6 (diff)
downloadpoky-19265918768e49d465352c36be1ae9ea21f4b5b2.tar.gz
bb/command|cooker: refactor the reparseFiles logic
Turn the reparseFiles logic into a command to reset the cooker's state machine and a noop which triggers a cache rebuild. The resetCooker command resets the cookers state machine such that a cache update will be triggered by any async command which requires the cache. The reparseFiles command remains as a noop async command that has the needcache property set to True so that when called it ensures the cache is built. Patch from Richard with the addition of removing the force parameter from the updateCache method. CC: Richard Purdie <richard.purdie@linuxfoundation.org> (Bitbake rev: a98f698fe9f38310024013e58475e6d1447ee154) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/command.py7
-rw-r--r--bitbake/lib/bb/cooker.py9
2 files changed, 13 insertions, 3 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 893a6d9070..41796f629e 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -172,6 +172,13 @@ class CommandsSync:
172 value = params[1] 172 value = params[1]
173 bb.data.setVar(varname, value, command.cooker.configuration.data) 173 bb.data.setVar(varname, value, command.cooker.configuration.data)
174 174
175 def resetCooker(self, command, params):
176 """
177 Reset the cooker to its initial state, thus forcing a reparse for
178 any async command that has the needcache property set to True
179 """
180 command.cooker.reset()
181
175 182
176class CommandsAsync: 183class CommandsAsync:
177 """ 184 """
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 490828d2a6..f7d9923f19 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1104,8 +1104,8 @@ class BBCooker:
1104 1104
1105 self.server_registration_cb(buildTargetsIdle, rq) 1105 self.server_registration_cb(buildTargetsIdle, rq)
1106 1106
1107 def updateCache(self, force=False): 1107 def updateCache(self):
1108 if self.state == state.running and not force: 1108 if self.state == state.running:
1109 return 1109 return
1110 1110
1111 if self.state in (state.shutdown, state.stop): 1111 if self.state in (state.shutdown, state.stop):
@@ -1290,8 +1290,11 @@ class BBCooker:
1290 self.state = state.stop 1290 self.state = state.stop
1291 1291
1292 def reparseFiles(self): 1292 def reparseFiles(self):
1293 return
1294
1295 def reset(self):
1296 self.state = state.initial
1293 self.loadConfigurationData() 1297 self.loadConfigurationData()
1294 self.updateCache(force=True)
1295 1298
1296def server_main(cooker, func, *args): 1299def server_main(cooker, func, *args):
1297 cooker.pre_serve() 1300 cooker.pre_serve()