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: value = params[1] bb.data.setVar(varname, value, command.cooker.configuration.data) + def resetCooker(self, command, params): + """ + Reset the cooker to its initial state, thus forcing a reparse for + any async command that has the needcache property set to True + """ + command.cooker.reset() + class CommandsAsync: """ 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: self.server_registration_cb(buildTargetsIdle, rq) - def updateCache(self, force=False): - if self.state == state.running and not force: + def updateCache(self): + if self.state == state.running: return if self.state in (state.shutdown, state.stop): @@ -1290,8 +1290,11 @@ class BBCooker: self.state = state.stop def reparseFiles(self): + return + + def reset(self): + self.state = state.initial self.loadConfigurationData() - self.updateCache(force=True) def server_main(cooker, func, *args): cooker.pre_serve()