summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-09-14 16:09:41 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-17 23:23:21 +0100
commita9b1aaced19bdafe5e3fb33cf455555d30b1a3ab (patch)
treec1fda48462b7a685b36c2dbef8086a30addb4f44 /bitbake
parentb2de5836e0760ba1242dbd6b18c067fcc5d79788 (diff)
downloadpoky-a9b1aaced19bdafe5e3fb33cf455555d30b1a3ab.tar.gz
bitbake: cooker: fix watching empty directories
The code that was supposed to watch directories along BBFILES for creation of new files wasn't working in the case where the directory did not initially contain any matching files - since in updateCache() we are passing the directory path to add_filewatch() and the latter function calls os.path.dirname() on the path on the assumption that it is a file path, and thus the parent of the directory got watched but not the directory itself. (If the directory wasn't empty everything worked fine since add_filewatch() was called elsewhere with the path to one of the files in that directory, and thus the directory got watched). Add a parameter to add_filewatch() to tell it we are passing it directory path(s) rather than file path(s). (Bitbake rev: 47a34dee08fcc25d896a1bdf16fa86267f0b898f) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 8fe36eba1e..6de04fcba6 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -266,12 +266,15 @@ class BBCooker:
266 self.inotify_modified_files.append(event.pathname) 266 self.inotify_modified_files.append(event.pathname)
267 self.parsecache_valid = False 267 self.parsecache_valid = False
268 268
269 def add_filewatch(self, deps, watcher=None): 269 def add_filewatch(self, deps, watcher=None, dirs=False):
270 if not watcher: 270 if not watcher:
271 watcher = self.watcher 271 watcher = self.watcher
272 for i in deps: 272 for i in deps:
273 watcher.bbwatchedfiles.append(i[0]) 273 watcher.bbwatchedfiles.append(i[0])
274 f = os.path.dirname(i[0]) 274 if dirs:
275 f = i[0]
276 else:
277 f = os.path.dirname(i[0])
275 if f in watcher.bbseen: 278 if f in watcher.bbseen:
276 continue 279 continue
277 watcher.bbseen.append(f) 280 watcher.bbseen.append(f)
@@ -1512,7 +1515,7 @@ class BBCooker:
1512 1515
1513 # Add inotify watches for directories searched for bb/bbappend files 1516 # Add inotify watches for directories searched for bb/bbappend files
1514 for dirent in searchdirs: 1517 for dirent in searchdirs:
1515 self.add_filewatch([[dirent]]) 1518 self.add_filewatch([[dirent]], dirs=True)
1516 1519
1517 self.parser = CookerParser(self, filelist, masked) 1520 self.parser = CookerParser(self, filelist, masked)
1518 self.parsecache_valid = True 1521 self.parsecache_valid = True