diff options
Diffstat (limited to 'bitbake/lib/bb/checksum.py')
-rw-r--r-- | bitbake/lib/bb/checksum.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bitbake/lib/bb/checksum.py b/bitbake/lib/bb/checksum.py index 1d50a26426..fb8a77f6ab 100644 --- a/bitbake/lib/bb/checksum.py +++ b/bitbake/lib/bb/checksum.py | |||
@@ -50,6 +50,7 @@ class FileChecksumCache(MultiProcessCache): | |||
50 | MultiProcessCache.__init__(self) | 50 | MultiProcessCache.__init__(self) |
51 | 51 | ||
52 | def get_checksum(self, f): | 52 | def get_checksum(self, f): |
53 | f = os.path.normpath(f) | ||
53 | entry = self.cachedata[0].get(f) | 54 | entry = self.cachedata[0].get(f) |
54 | cmtime = self.mtime_cache.cached_mtime(f) | 55 | cmtime = self.mtime_cache.cached_mtime(f) |
55 | if entry: | 56 | if entry: |
@@ -84,15 +85,24 @@ class FileChecksumCache(MultiProcessCache): | |||
84 | return None | 85 | return None |
85 | return checksum | 86 | return checksum |
86 | 87 | ||
88 | # | ||
89 | # Changing the format of file-checksums is problematic as both OE and Bitbake have | ||
90 | # knowledge of them. We need to encode a new piece of data, the portion of the path | ||
91 | # we care about from a checksum perspective. This means that files that change subdirectory | ||
92 | # are tracked by the task hashes. To do this, we do something horrible and put a "/./" into | ||
93 | # the path. The filesystem handles it but it gives us a marker to know which subsection | ||
94 | # of the path to cache. | ||
95 | # | ||
87 | def checksum_dir(pth): | 96 | def checksum_dir(pth): |
88 | # Handle directories recursively | 97 | # Handle directories recursively |
89 | if pth == "/": | 98 | if pth == "/": |
90 | bb.fatal("Refusing to checksum /") | 99 | bb.fatal("Refusing to checksum /") |
100 | pth = pth.rstrip("/") | ||
91 | dirchecksums = [] | 101 | dirchecksums = [] |
92 | for root, dirs, files in os.walk(pth, topdown=True): | 102 | for root, dirs, files in os.walk(pth, topdown=True): |
93 | [dirs.remove(d) for d in list(dirs) if d in localdirsexclude] | 103 | [dirs.remove(d) for d in list(dirs) if d in localdirsexclude] |
94 | for name in files: | 104 | for name in files: |
95 | fullpth = os.path.join(root, name) | 105 | fullpth = os.path.join(root, name).replace(pth, os.path.join(pth, ".")) |
96 | checksum = checksum_file(fullpth) | 106 | checksum = checksum_file(fullpth) |
97 | if checksum: | 107 | if checksum: |
98 | dirchecksums.append((fullpth, checksum)) | 108 | dirchecksums.append((fullpth, checksum)) |