diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-17 12:12:19 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-19 18:05:45 +0100 |
commit | 37a2c062a5919473157e236fbb19a1eafba00f8e (patch) | |
tree | 2d4a8f8a5df6ca6463558ab0841637e1e070e726 /bitbake/lib/bb/cooker.py | |
parent | 6e5ac6ba8e229b5f8963efdce23072cf3b2b6dfc (diff) | |
download | poky-37a2c062a5919473157e236fbb19a1eafba00f8e.tar.gz |
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 <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 'bitbake/lib/bb/cooker.py')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 27 |
1 files changed, 16 insertions, 11 deletions
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: | |||
1445 | if timestamp: | 1445 | if timestamp: |
1446 | return timestr | 1446 | return timestr |
1447 | 1447 | ||
1448 | def updateCacheSync(self): | ||
1449 | if self.state == state.running: | ||
1450 | return | ||
1451 | |||
1452 | # reload files for which we got notifications | ||
1453 | for p in self.inotify_modified_files: | ||
1454 | bb.parse.update_cache(p) | ||
1455 | self.inotify_modified_files = [] | ||
1456 | |||
1457 | if not self.baseconfig_valid: | ||
1458 | logger.debug(1, "Reloading base configuration data") | ||
1459 | self.initConfigurationData() | ||
1460 | self.baseconfig_valid = True | ||
1461 | self.parsecache_valid = False | ||
1462 | |||
1448 | # This is called for all async commands when self.state != running | 1463 | # This is called for all async commands when self.state != running |
1449 | def updateCache(self): | 1464 | def updateCache(self): |
1450 | if self.state == state.running: | 1465 | if self.state == state.running: |
@@ -1456,17 +1471,7 @@ class BBCooker: | |||
1456 | raise bb.BBHandledException() | 1471 | raise bb.BBHandledException() |
1457 | 1472 | ||
1458 | if self.state != state.parsing: | 1473 | if self.state != state.parsing: |
1459 | 1474 | self.updateCacheSync() | |
1460 | # reload files for which we got notifications | ||
1461 | for p in self.inotify_modified_files: | ||
1462 | bb.parse.update_cache(p) | ||
1463 | self.inotify_modified_files = [] | ||
1464 | |||
1465 | if not self.baseconfig_valid: | ||
1466 | logger.debug(1, "Reloading base configuration data") | ||
1467 | self.initConfigurationData() | ||
1468 | self.baseconfig_valid = True | ||
1469 | self.parsecache_valid = False | ||
1470 | 1475 | ||
1471 | if self.state != state.parsing and not self.parsecache_valid: | 1476 | if self.state != state.parsing and not self.parsecache_valid: |
1472 | self.parseConfiguration () | 1477 | self.parseConfiguration () |