summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/siggen.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-01-12 15:58:48 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-01-12 15:58:48 +0000
commit25b3d39612c0bea1d136e346d938abde56aa699f (patch)
tree55c4218de429a3e5f861734b1d2966a4fb360dff /bitbake/lib/bb/siggen.py
parent041adc97125189d1d91ecc7de16ff0e3e386e15b (diff)
downloadpoky-25b3d39612c0bea1d136e346d938abde56aa699f.tar.gz
bitbake/siggen.py: Fix whitelisted variable handling
Even when a variable was whitelisted, any dependencies of that variable could still creep into the task hash due to the way the whitelisting code worked. This patch changes thing to ensure that when whitelisted, that whitelisting applies to the variable and any dependencies it has. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/siggen.py')
-rw-r--r--bitbake/lib/bb/siggen.py27
1 files changed, 21 insertions, 6 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 4dc09b3f9e..010c2cab26 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -57,7 +57,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
57 self.runtaskdeps = {} 57 self.runtaskdeps = {}
58 self.gendeps = {} 58 self.gendeps = {}
59 self.lookupcache = {} 59 self.lookupcache = {}
60 self.basewhitelist = (data.getVar("BB_HASHBASE_WHITELIST", True) or "").split() 60 self.basewhitelist = set((data.getVar("BB_HASHBASE_WHITELIST", True) or "").split())
61 self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST", True) or None 61 self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST", True) or None
62 62
63 if self.taskwhitelist: 63 if self.taskwhitelist:
@@ -67,17 +67,31 @@ class SignatureGeneratorBasic(SignatureGenerator):
67 67
68 def _build_data(self, fn, d): 68 def _build_data(self, fn, d):
69 69
70 taskdeps, gendeps = bb.data.generate_dependencies(d) 70 tasklist, gendeps = bb.data.generate_dependencies(d)
71 71
72 taskdeps = {}
72 basehash = {} 73 basehash = {}
73 lookupcache = {} 74 lookupcache = {}
74 75
75 for task in taskdeps: 76 for task in tasklist:
76 data = d.getVar(task, False) 77 data = d.getVar(task, False)
77 lookupcache[task] = data 78 lookupcache[task] = data
78 for dep in sorted(taskdeps[task]): 79
79 if dep in self.basewhitelist: 80 newdeps = gendeps[task]
80 continue 81 seen = set()
82 while newdeps:
83 nextdeps = newdeps
84 seen |= nextdeps
85 newdeps = set()
86 for dep in nextdeps:
87 if dep in self.basewhitelist:
88 continue
89 newdeps |= gendeps[dep]
90 newdeps -= seen
91
92 alldeps = seen - self.basewhitelist
93
94 for dep in sorted(alldeps):
81 if dep in lookupcache: 95 if dep in lookupcache:
82 var = lookupcache[dep] 96 var = lookupcache[dep]
83 else: 97 else:
@@ -88,6 +102,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
88 if data is None: 102 if data is None:
89 bb.error("Task %s from %s seems to be empty?!" % (task, fn)) 103 bb.error("Task %s from %s seems to be empty?!" % (task, fn))
90 self.basehash[fn + "." + task] = hashlib.md5(data).hexdigest() 104 self.basehash[fn + "." + task] = hashlib.md5(data).hexdigest()
105 taskdeps[task] = sorted(alldeps)
91 106
92 self.taskdeps[fn] = taskdeps 107 self.taskdeps[fn] = taskdeps
93 self.gendeps[fn] = gendeps 108 self.gendeps[fn] = gendeps