diff options
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 3909dc09f7..2f2a8523af 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -133,6 +133,19 @@ class BBCooker: | |||
133 | 133 | ||
134 | 134 | ||
135 | self.initConfigurationData() | 135 | self.initConfigurationData() |
136 | |||
137 | self.inotify_modified_files = [] | ||
138 | |||
139 | def _process_inotify_updates(server, notifier_list, abort): | ||
140 | for n in notifier_list: | ||
141 | if n.check_events(timeout=0): | ||
142 | # read notified events and enqeue them | ||
143 | n.read_events() | ||
144 | n.process_events() | ||
145 | return True | ||
146 | |||
147 | self.configuration.server_register_idlecallback(_process_inotify_updates, [self.confignotifier, self.notifier]) | ||
148 | |||
136 | self.baseconfig_valid = True | 149 | self.baseconfig_valid = True |
137 | self.parsecache_valid = False | 150 | self.parsecache_valid = False |
138 | 151 | ||
@@ -171,11 +184,13 @@ class BBCooker: | |||
171 | signal.signal(signal.SIGHUP, self.sigterm_exception) | 184 | signal.signal(signal.SIGHUP, self.sigterm_exception) |
172 | 185 | ||
173 | def config_notifications(self, event): | 186 | def config_notifications(self, event): |
174 | bb.parse.update_cache(event.path) | 187 | if not event.path in self.inotify_modified_files: |
188 | self.inotify_modified_files.append(event.path) | ||
175 | self.baseconfig_valid = False | 189 | self.baseconfig_valid = False |
176 | 190 | ||
177 | def notifications(self, event): | 191 | def notifications(self, event): |
178 | bb.parse.update_cache(event.path) | 192 | if not event.path in self.inotify_modified_files: |
193 | self.inotify_modified_files.append(event.path) | ||
179 | self.parsecache_valid = False | 194 | self.parsecache_valid = False |
180 | 195 | ||
181 | def add_filewatch(self, deps, watcher=None): | 196 | def add_filewatch(self, deps, watcher=None): |
@@ -1336,11 +1351,12 @@ class BBCooker: | |||
1336 | raise bb.BBHandledException() | 1351 | raise bb.BBHandledException() |
1337 | 1352 | ||
1338 | if self.state != state.parsing: | 1353 | if self.state != state.parsing: |
1339 | for n in [self.confignotifier, self.notifier]: | 1354 | |
1340 | if n.check_events(timeout=0): | 1355 | # reload files for which we got notifications |
1341 | # read notified events and enqeue them | 1356 | for p in self.inotify_modified_files: |
1342 | n.read_events() | 1357 | bb.parse.update_cache(p) |
1343 | n.process_events() | 1358 | self.inotify_modified_files = [] |
1359 | |||
1344 | if not self.baseconfig_valid: | 1360 | if not self.baseconfig_valid: |
1345 | logger.debug(1, "Reloading base configuration data") | 1361 | logger.debug(1, "Reloading base configuration data") |
1346 | self.initConfigurationData() | 1362 | self.initConfigurationData() |