From 37a2c062a5919473157e236fbb19a1eafba00f8e Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 17 Aug 2015 12:12:19 +0100 Subject: bitbake: command: ensure sync commands that read configuration see updates Add a means of ensuring that synchronous commands that read the results of the configuration trigger a reparse of the configuration if any underlying files have changed. (Bitbake rev: aaf3cc024315450c1674819edf2a4e5cdf293f35) Signed-off-by: Richard Purdie Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- bitbake/lib/bb/cooker.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'bitbake/lib/bb/cooker.py') diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index f0f9c66f4e..fb38289397 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -1445,6 +1445,21 @@ class BBCooker: if timestamp: return timestr + def updateCacheSync(self): + if self.state == state.running: + return + + # reload files for which we got notifications + for p in self.inotify_modified_files: + bb.parse.update_cache(p) + self.inotify_modified_files = [] + + if not self.baseconfig_valid: + logger.debug(1, "Reloading base configuration data") + self.initConfigurationData() + self.baseconfig_valid = True + self.parsecache_valid = False + # This is called for all async commands when self.state != running def updateCache(self): if self.state == state.running: @@ -1456,17 +1471,7 @@ class BBCooker: raise bb.BBHandledException() if self.state != state.parsing: - - # reload files for which we got notifications - for p in self.inotify_modified_files: - bb.parse.update_cache(p) - self.inotify_modified_files = [] - - if not self.baseconfig_valid: - logger.debug(1, "Reloading base configuration data") - self.initConfigurationData() - self.baseconfig_valid = True - self.parsecache_valid = False + self.updateCacheSync() if self.state != state.parsing and not self.parsecache_valid: self.parseConfiguration () -- cgit v1.2.3-54-g00ecf