diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-01-20 16:16:08 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-01-20 16:47:40 +0000 |
commit | 7a8bae92ed18f5e79e4a982c226ec94e197587e8 (patch) | |
tree | 1ec665799fe0acbce42476b8d94d3779fa63194f /bitbake/lib/bb/siggen.py | |
parent | c4a8fab1a42ad9d80541cadab57c8c66f91c04b0 (diff) | |
download | poky-7a8bae92ed18f5e79e4a982c226ec94e197587e8.tar.gz |
siggen.py: Abstract the runtime task dependency handling code in the generators
This means that custom signature handlers can override specific parts
of the code without having to reimplement whole functions allowing them
more flexibility.
(Bitbake rev: 164195c068a656733cfe7aa07369c5ed6ea62ca5)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/siggen.py')
-rw-r--r-- | bitbake/lib/bb/siggen.py | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index d9d0294615..f31d66a176 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/lib/bb/siggen.py | |||
@@ -62,9 +62,13 @@ class SignatureGeneratorBasic(SignatureGenerator): | |||
62 | self.runtaskdeps = {} | 62 | self.runtaskdeps = {} |
63 | self.gendeps = {} | 63 | self.gendeps = {} |
64 | self.lookupcache = {} | 64 | self.lookupcache = {} |
65 | self.pkgnameextract = re.compile("(?P<fn>.*)\..*") | ||
65 | self.basewhitelist = set((data.getVar("BB_HASHBASE_WHITELIST", True) or "").split()) | 66 | self.basewhitelist = set((data.getVar("BB_HASHBASE_WHITELIST", True) or "").split()) |
66 | self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST", True) or None | 67 | self.taskwhitelist = None |
68 | self.init_rundepcheck(data) | ||
67 | 69 | ||
70 | def init_rundepcheck(self, data): | ||
71 | self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST", True) or None | ||
68 | if self.taskwhitelist: | 72 | if self.taskwhitelist: |
69 | self.twl = re.compile(self.taskwhitelist) | 73 | self.twl = re.compile(self.taskwhitelist) |
70 | else: | 74 | else: |
@@ -131,17 +135,24 @@ class SignatureGeneratorBasic(SignatureGenerator): | |||
131 | for task in taskdeps: | 135 | for task in taskdeps: |
132 | d.setVar("BB_BASEHASH_task-%s" % task, self.basehash[fn + "." + task]) | 136 | d.setVar("BB_BASEHASH_task-%s" % task, self.basehash[fn + "." + task]) |
133 | 137 | ||
138 | def rundep_check(self, fn, recipename, task, dep, depname): | ||
139 | # Return True if we should keep the dependency, False to drop it | ||
140 | # We only manipulate the dependencies for packages not in the whitelist | ||
141 | if self.twl and not self.twl.search(recipename): | ||
142 | # then process the actual dependencies | ||
143 | if self.twl.search(depname): | ||
144 | return False | ||
145 | return True | ||
146 | |||
134 | def get_taskhash(self, fn, task, deps, dataCache): | 147 | def get_taskhash(self, fn, task, deps, dataCache): |
135 | k = fn + "." + task | 148 | k = fn + "." + task |
136 | data = dataCache.basetaskhash[k] | 149 | data = dataCache.basetaskhash[k] |
137 | self.runtaskdeps[k] = [] | 150 | self.runtaskdeps[k] = [] |
151 | recipename = dataCache.pkg_fn[fn] | ||
138 | for dep in sorted(deps, key=clean_basepath): | 152 | for dep in sorted(deps, key=clean_basepath): |
139 | # We only manipulate the dependencies for packages not in the whitelist | 153 | depname = dataCache.pkg_fn[self.pkgnameextract.search(dep).group('fn')] |
140 | if self.twl and not self.twl.search(dataCache.pkg_fn[fn]): | 154 | if not self.rundep_check(fn, recipename, task, dep, depname): |
141 | # then process the actual dependencies | 155 | continue |
142 | dep_fn = re.search("(?P<fn>.*)\..*", dep).group('fn') | ||
143 | if self.twl.search(dataCache.pkg_fn[dep_fn]): | ||
144 | continue | ||
145 | if dep not in self.taskhash: | 156 | if dep not in self.taskhash: |
146 | bb.fatal("%s is not in taskhash, caller isn't calling in dependency order?", dep) | 157 | bb.fatal("%s is not in taskhash, caller isn't calling in dependency order?", dep) |
147 | data = data + self.taskhash[dep] | 158 | data = data + self.taskhash[dep] |