diff options
Diffstat (limited to 'bitbake/lib')
| -rw-r--r-- | bitbake/lib/bb/cooker.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index b5a5281c0e..614d47d16f 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
| @@ -176,9 +176,23 @@ class BBCooker: | |||
| 176 | bb.parse.update_cache(event.path) | 176 | bb.parse.update_cache(event.path) |
| 177 | self.parsecache_valid = False | 177 | self.parsecache_valid = False |
| 178 | 178 | ||
| 179 | def add_filewatch(self, deps): | 179 | def add_filewatch(self, deps, watcher=None): |
| 180 | if not watcher: | ||
| 181 | watcher = self.watcher | ||
| 180 | for i in deps: | 182 | for i in deps: |
| 181 | self.watcher.add_watch(i[0], self.watchmask, rec=True) | 183 | f = i[0] |
| 184 | while True: | ||
| 185 | # We try and add watches for files that don't exist but if they did, would influence | ||
| 186 | # the parser. The parent directory of these files may not exist, in which case we need | ||
| 187 | # to watch any parent that does exist for changes. | ||
| 188 | try: | ||
| 189 | watcher.add_watch(f, self.watchmask, quiet=False) | ||
| 190 | break | ||
| 191 | except pyinotify.WatchManagerError as e: | ||
| 192 | if 'ENOENT' in str(e): | ||
| 193 | f = os.path.dirname(f) | ||
| 194 | continue | ||
| 195 | raise | ||
| 182 | 196 | ||
| 183 | def sigterm_exception(self, signum, stackframe): | 197 | def sigterm_exception(self, signum, stackframe): |
| 184 | if signum == signal.SIGTERM: | 198 | if signum == signal.SIGTERM: |
| @@ -1342,8 +1356,7 @@ class BBCooker: | |||
| 1342 | (filelist, masked) = self.collection.collect_bbfiles(self.data, self.event_data) | 1356 | (filelist, masked) = self.collection.collect_bbfiles(self.data, self.event_data) |
| 1343 | 1357 | ||
| 1344 | self.data.renameVar("__depends", "__base_depends") | 1358 | self.data.renameVar("__depends", "__base_depends") |
| 1345 | for i in self.data.getVar("__base_depends"): | 1359 | self.add_filewatch(self.data.getVar("__base_depends"), self.configwatcher) |
| 1346 | self.wdd = self.configwatcher.add_watch(i[0], self.watchmask, rec=True) | ||
| 1347 | 1360 | ||
| 1348 | self.parser = CookerParser(self, filelist, masked) | 1361 | self.parser = CookerParser(self, filelist, masked) |
| 1349 | self.parsecache_valid = True | 1362 | self.parsecache_valid = True |
