summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/siggen.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-15 14:41:57 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-08 22:01:19 +0000
commit267eca35c1ac1e59a780ff433ad32018e294cc0f (patch)
tree2003f5d106602d04dc4fb8e6548b719405cc8d76 /bitbake/lib/bb/siggen.py
parentbf411441f5368284ae6a6ac9707c689f48973083 (diff)
downloadpoky-267eca35c1ac1e59a780ff433ad32018e294cc0f.tar.gz
bitbake: fetch2/checksum/siggen: Fix taskhashes not tracking file directories
Currently if you have something like: SRC_URI = "file://foobar;subdir=${S}" and a file like: foobar/1/somefile and then move it to: foobar/2/somefile the task checksums don't reflect/notice this. The file-checksum fields encode two pieces of data, the file path and whether or not the file exists. Changing the code which uses these fields is problematic. We can however add a "/./" path element which means "include the bit after the marker in the checksum" which the path walking code can use to mark which bits of the path are visible to the fetcher. I'm not convinced this is great design but it does appear to work. (Bitbake rev: b4975d2ecf615ac4c240808fbc5a3f879a93846b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/siggen.py')
-rw-r--r--bitbake/lib/bb/siggen.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 578ba5d661..44965c8cca 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -328,6 +328,8 @@ class SignatureGeneratorBasic(SignatureGenerator):
328 328
329 for (f, cs) in self.file_checksum_values[tid]: 329 for (f, cs) in self.file_checksum_values[tid]:
330 if cs: 330 if cs:
331 if "/./" in f:
332 data = data + "./" + f.split("/./")[1]
331 data = data + cs 333 data = data + cs
332 334
333 if tid in self.taints: 335 if tid in self.taints:
@@ -385,7 +387,12 @@ class SignatureGeneratorBasic(SignatureGenerator):
385 387
386 if runtime and tid in self.taskhash: 388 if runtime and tid in self.taskhash:
387 data['runtaskdeps'] = self.runtaskdeps[tid] 389 data['runtaskdeps'] = self.runtaskdeps[tid]
388 data['file_checksum_values'] = [(os.path.basename(f), cs) for f,cs in self.file_checksum_values[tid]] 390 data['file_checksum_values'] = []
391 for f,cs in self.file_checksum_values[tid]:
392 if "/./" in f:
393 data['file_checksum_values'].append(("./" + f.split("/./")[1], cs))
394 else:
395 data['file_checksum_values'].append((os.path.basename(f), cs))
389 data['runtaskhashes'] = {} 396 data['runtaskhashes'] = {}
390 for dep in data['runtaskdeps']: 397 for dep in data['runtaskdeps']:
391 data['runtaskhashes'][dep] = self.get_unihash(dep) 398 data['runtaskhashes'][dep] = self.get_unihash(dep)
@@ -1028,6 +1035,8 @@ def calc_taskhash(sigdata):
1028 1035
1029 for c in sigdata['file_checksum_values']: 1036 for c in sigdata['file_checksum_values']:
1030 if c[1]: 1037 if c[1]:
1038 if "./" in c[0]:
1039 data = data + c[0]
1031 data = data + c[1] 1040 data = data + c[1]
1032 1041
1033 if 'taint' in sigdata: 1042 if 'taint' in sigdata: