summaryrefslogtreecommitdiffstats
path: root/lib/bb/cooker.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-17 12:12:19 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-17 14:40:56 +0100
commitaaf3cc024315450c1674819edf2a4e5cdf293f35 (patch)
tree7f0702ecac7a767e32c9e6a324ced83806dcc634 /lib/bb/cooker.py
parentbc39b8da34c046b629c43fd0a8cac2efbf1c060f (diff)
downloadbitbake-contrib-aaf3cc024315450c1674819edf2a4e5cdf293f35.tar.gz
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cooker.py')
-rw-r--r--lib/bb/cooker.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index f0f9c66f4..fb3828939 100644
--- a/lib/bb/cooker.py
+++ b/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 ()