summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/cooker.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index f14eb64c83..d065b4dc4e 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:
@@ -1411,8 +1425,7 @@ class BBCooker:
1411 (filelist, masked) = self.collection.collect_bbfiles(self.data, self.event_data) 1425 (filelist, masked) = self.collection.collect_bbfiles(self.data, self.event_data)
1412 1426
1413 self.data.renameVar("__depends", "__base_depends") 1427 self.data.renameVar("__depends", "__base_depends")
1414 for i in self.data.getVar("__base_depends"): 1428 self.add_filewatch(self.data.getVar("__base_depends"), self.configwatcher)
1415 self.wdd = self.configwatcher.add_watch(i[0], self.watchmask, rec=True)
1416 1429
1417 self.parser = CookerParser(self, filelist, masked) 1430 self.parser = CookerParser(self, filelist, masked)
1418 self.parsecache_valid = True 1431 self.parsecache_valid = True