diff options
Diffstat (limited to 'bitbake/lib/bb/checksum.py')
-rw-r--r-- | bitbake/lib/bb/checksum.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/bitbake/lib/bb/checksum.py b/bitbake/lib/bb/checksum.py index 1d50a26426..557793d366 100644 --- a/bitbake/lib/bb/checksum.py +++ b/bitbake/lib/bb/checksum.py @@ -11,10 +11,13 @@ import os import stat import bb.utils import logging +import re from bb.cache import MultiProcessCache logger = logging.getLogger("BitBake.Cache") +filelist_regex = re.compile(r'(?:(?<=:True)|(?<=:False))\s+') + # mtime cache (non-persistent) # based upon the assumption that files do not change during bitbake run class FileMtimeCache(object): @@ -50,6 +53,7 @@ class FileChecksumCache(MultiProcessCache): MultiProcessCache.__init__(self) def get_checksum(self, f): + f = os.path.normpath(f) entry = self.cachedata[0].get(f) cmtime = self.mtime_cache.cached_mtime(f) if entry: @@ -84,22 +88,36 @@ class FileChecksumCache(MultiProcessCache): return None return checksum + # + # Changing the format of file-checksums is problematic as both OE and Bitbake have + # knowledge of them. We need to encode a new piece of data, the portion of the path + # we care about from a checksum perspective. This means that files that change subdirectory + # are tracked by the task hashes. To do this, we do something horrible and put a "/./" into + # the path. The filesystem handles it but it gives us a marker to know which subsection + # of the path to cache. + # def checksum_dir(pth): # Handle directories recursively if pth == "/": bb.fatal("Refusing to checksum /") + pth = pth.rstrip("/") dirchecksums = [] for root, dirs, files in os.walk(pth, topdown=True): [dirs.remove(d) for d in list(dirs) if d in localdirsexclude] for name in files: - fullpth = os.path.join(root, name) + fullpth = os.path.join(root, name).replace(pth, os.path.join(pth, ".")) checksum = checksum_file(fullpth) if checksum: dirchecksums.append((fullpth, checksum)) return dirchecksums checksums = [] - for pth in filelist.split(): + for pth in filelist_regex.split(filelist): + if not pth: + continue + pth = pth.strip() + if not pth: + continue exist = pth.split(":")[1] if exist == "False": continue |