diff options
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
| -rw-r--r-- | bitbake/lib/bb/cooker.py | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 3740c61dc6..ea4df266f5 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
| @@ -1192,7 +1192,7 @@ class BBCooker: | |||
| 1192 | bf = os.path.abspath(bf) | 1192 | bf = os.path.abspath(bf) |
| 1193 | 1193 | ||
| 1194 | self.collection = CookerCollectFiles(self.bbfile_config_priorities) | 1194 | self.collection = CookerCollectFiles(self.bbfile_config_priorities) |
| 1195 | filelist, masked = self.collection.collect_bbfiles(self.data, self.data) | 1195 | filelist, masked, searchdirs = self.collection.collect_bbfiles(self.data, self.data) |
| 1196 | try: | 1196 | try: |
| 1197 | os.stat(bf) | 1197 | os.stat(bf) |
| 1198 | bf = os.path.abspath(bf) | 1198 | bf = os.path.abspath(bf) |
| @@ -1482,7 +1482,11 @@ class BBCooker: | |||
| 1482 | self.recipecaches[mc].ignored_dependencies.add(dep) | 1482 | self.recipecaches[mc].ignored_dependencies.add(dep) |
| 1483 | 1483 | ||
| 1484 | self.collection = CookerCollectFiles(self.bbfile_config_priorities) | 1484 | self.collection = CookerCollectFiles(self.bbfile_config_priorities) |
| 1485 | (filelist, masked) = self.collection.collect_bbfiles(self.data, self.data) | 1485 | (filelist, masked, searchdirs) = self.collection.collect_bbfiles(self.data, self.data) |
| 1486 | |||
| 1487 | # Add inotify watches for directories searched for bb/bbappend files | ||
| 1488 | for dirent in searchdirs: | ||
| 1489 | self.add_filewatch([[dirent]]) | ||
| 1486 | 1490 | ||
| 1487 | self.parser = CookerParser(self, filelist, masked) | 1491 | self.parser = CookerParser(self, filelist, masked) |
| 1488 | self.parsecache_valid = True | 1492 | self.parsecache_valid = True |
| @@ -1654,6 +1658,18 @@ class CookerCollectFiles(object): | |||
| 1654 | collectlog.error("no recipe files to build, check your BBPATH and BBFILES?") | 1658 | collectlog.error("no recipe files to build, check your BBPATH and BBFILES?") |
| 1655 | bb.event.fire(CookerExit(), eventdata) | 1659 | bb.event.fire(CookerExit(), eventdata) |
| 1656 | 1660 | ||
| 1661 | # We need to track where we look so that we can add inotify watches. There | ||
| 1662 | # is no nice way to do this, this is horrid. We intercept the os.listdir() | ||
| 1663 | # calls while we run glob(). | ||
| 1664 | origlistdir = os.listdir | ||
| 1665 | searchdirs = [] | ||
| 1666 | |||
| 1667 | def ourlistdir(d): | ||
| 1668 | searchdirs.append(d) | ||
| 1669 | return origlistdir(d) | ||
| 1670 | |||
| 1671 | os.listdir = ourlistdir | ||
| 1672 | |||
| 1657 | # Can't use set here as order is important | 1673 | # Can't use set here as order is important |
| 1658 | newfiles = [] | 1674 | newfiles = [] |
| 1659 | for f in files: | 1675 | for f in files: |
| @@ -1671,6 +1687,8 @@ class CookerCollectFiles(object): | |||
| 1671 | if g not in newfiles: | 1687 | if g not in newfiles: |
| 1672 | newfiles.append(g) | 1688 | newfiles.append(g) |
| 1673 | 1689 | ||
| 1690 | os.listdir = origlistdir | ||
| 1691 | |||
| 1674 | bbmask = config.getVar('BBMASK') | 1692 | bbmask = config.getVar('BBMASK') |
| 1675 | 1693 | ||
| 1676 | if bbmask: | 1694 | if bbmask: |
| @@ -1729,7 +1747,7 @@ class CookerCollectFiles(object): | |||
| 1729 | topfile = bbfile_seen[base] | 1747 | topfile = bbfile_seen[base] |
| 1730 | self.overlayed[topfile].append(f) | 1748 | self.overlayed[topfile].append(f) |
| 1731 | 1749 | ||
| 1732 | return (bbfiles, masked) | 1750 | return (bbfiles, masked, searchdirs) |
| 1733 | 1751 | ||
| 1734 | def get_file_appends(self, fn): | 1752 | def get_file_appends(self, fn): |
| 1735 | """ | 1753 | """ |
