diff options
Diffstat (limited to 'bitbake')
-rwxr-xr-x | bitbake/bin/bitbake-diffsigs | 9 | ||||
-rw-r--r-- | bitbake/lib/bb/codeparser.py | 33 | ||||
-rw-r--r-- | bitbake/lib/bb/data.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/fetch2/clearcase.py | 4 |
4 files changed, 30 insertions, 18 deletions
diff --git a/bitbake/bin/bitbake-diffsigs b/bitbake/bin/bitbake-diffsigs index 8202c78623..9d6cb8c944 100755 --- a/bitbake/bin/bitbake-diffsigs +++ b/bitbake/bin/bitbake-diffsigs | |||
@@ -72,16 +72,17 @@ def find_siginfo_task(bbhandler, pn, taskname, sig1=None, sig2=None): | |||
72 | elif sig2 not in sigfiles: | 72 | elif sig2 not in sigfiles: |
73 | logger.error('No sigdata files found matching %s %s with signature %s' % (pn, taskname, sig2)) | 73 | logger.error('No sigdata files found matching %s %s with signature %s' % (pn, taskname, sig2)) |
74 | sys.exit(1) | 74 | sys.exit(1) |
75 | |||
76 | latestfiles = [sigfiles[sig1]['path'], sigfiles[sig2]['path']] | ||
75 | else: | 77 | else: |
76 | sigfiles = find_siginfo(bbhandler, pn, taskname) | 78 | sigfiles = find_siginfo(bbhandler, pn, taskname) |
77 | latestsigs = sorted(sigfiles.keys(), key=lambda h: sigfiles[h]['time'])[-2:] | 79 | latestsigs = sorted(sigfiles.keys(), key=lambda h: sigfiles[h]['time'])[-2:] |
78 | if not latestsigs: | 80 | if not latestsigs: |
79 | logger.error('No sigdata files found matching %s %s' % (pn, taskname)) | 81 | logger.error('No sigdata files found matching %s %s' % (pn, taskname)) |
80 | sys.exit(1) | 82 | sys.exit(1) |
81 | sig1 = latestsigs[0] | 83 | latestfiles = [sigfiles[latestsigs[0]]['path']] |
82 | sig2 = latestsigs[1] | 84 | if len(latestsigs) > 1: |
83 | 85 | latestfiles.append(sigfiles[latestsigs[1]]['path']) | |
84 | latestfiles = [sigfiles[sig1]['path'], sigfiles[sig2]['path']] | ||
85 | 86 | ||
86 | return latestfiles | 87 | return latestfiles |
87 | 88 | ||
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py index 691bdff75e..b25a2133d2 100644 --- a/bitbake/lib/bb/codeparser.py +++ b/bitbake/lib/bb/codeparser.py | |||
@@ -72,6 +72,11 @@ def add_module_functions(fn, functions, namespace): | |||
72 | parser.parse_python(None, filename=fn, lineno=1, fixedhash=fixedhash+f) | 72 | parser.parse_python(None, filename=fn, lineno=1, fixedhash=fixedhash+f) |
73 | #bb.warn("Cached %s" % f) | 73 | #bb.warn("Cached %s" % f) |
74 | except KeyError: | 74 | except KeyError: |
75 | targetfn = inspect.getsourcefile(functions[f]) | ||
76 | if fn != targetfn: | ||
77 | # Skip references to other modules outside this file | ||
78 | #bb.warn("Skipping %s" % name) | ||
79 | continue | ||
75 | lines, lineno = inspect.getsourcelines(functions[f]) | 80 | lines, lineno = inspect.getsourcelines(functions[f]) |
76 | src = "".join(lines) | 81 | src = "".join(lines) |
77 | parser.parse_python(src, filename=fn, lineno=lineno, fixedhash=fixedhash+f) | 82 | parser.parse_python(src, filename=fn, lineno=lineno, fixedhash=fixedhash+f) |
@@ -82,14 +87,14 @@ def add_module_functions(fn, functions, namespace): | |||
82 | if e in functions: | 87 | if e in functions: |
83 | execs.remove(e) | 88 | execs.remove(e) |
84 | execs.add(namespace + "." + e) | 89 | execs.add(namespace + "." + e) |
85 | modulecode_deps[name] = [parser.references.copy(), execs, parser.var_execs.copy(), parser.contains.copy()] | 90 | modulecode_deps[name] = [parser.references.copy(), execs, parser.var_execs.copy(), parser.contains.copy(), parser.extra] |
86 | #bb.warn("%s: %s\nRefs:%s Execs: %s %s %s" % (name, fn, parser.references, parser.execs, parser.var_execs, parser.contains)) | 91 | #bb.warn("%s: %s\nRefs:%s Execs: %s %s %s" % (name, fn, parser.references, parser.execs, parser.var_execs, parser.contains)) |
87 | 92 | ||
88 | def update_module_dependencies(d): | 93 | def update_module_dependencies(d): |
89 | for mod in modulecode_deps: | 94 | for mod in modulecode_deps: |
90 | excludes = set((d.getVarFlag(mod, "vardepsexclude") or "").split()) | 95 | excludes = set((d.getVarFlag(mod, "vardepsexclude") or "").split()) |
91 | if excludes: | 96 | if excludes: |
92 | modulecode_deps[mod] = [modulecode_deps[mod][0] - excludes, modulecode_deps[mod][1] - excludes, modulecode_deps[mod][2] - excludes, modulecode_deps[mod][3]] | 97 | modulecode_deps[mod] = [modulecode_deps[mod][0] - excludes, modulecode_deps[mod][1] - excludes, modulecode_deps[mod][2] - excludes, modulecode_deps[mod][3], modulecode_deps[mod][4]] |
93 | 98 | ||
94 | # A custom getstate/setstate using tuples is actually worth 15% cachesize by | 99 | # A custom getstate/setstate using tuples is actually worth 15% cachesize by |
95 | # avoiding duplication of the attribute names! | 100 | # avoiding duplication of the attribute names! |
@@ -112,21 +117,22 @@ class SetCache(object): | |||
112 | codecache = SetCache() | 117 | codecache = SetCache() |
113 | 118 | ||
114 | class pythonCacheLine(object): | 119 | class pythonCacheLine(object): |
115 | def __init__(self, refs, execs, contains): | 120 | def __init__(self, refs, execs, contains, extra): |
116 | self.refs = codecache.internSet(refs) | 121 | self.refs = codecache.internSet(refs) |
117 | self.execs = codecache.internSet(execs) | 122 | self.execs = codecache.internSet(execs) |
118 | self.contains = {} | 123 | self.contains = {} |
119 | for c in contains: | 124 | for c in contains: |
120 | self.contains[c] = codecache.internSet(contains[c]) | 125 | self.contains[c] = codecache.internSet(contains[c]) |
126 | self.extra = extra | ||
121 | 127 | ||
122 | def __getstate__(self): | 128 | def __getstate__(self): |
123 | return (self.refs, self.execs, self.contains) | 129 | return (self.refs, self.execs, self.contains, self.extra) |
124 | 130 | ||
125 | def __setstate__(self, state): | 131 | def __setstate__(self, state): |
126 | (refs, execs, contains) = state | 132 | (refs, execs, contains, extra) = state |
127 | self.__init__(refs, execs, contains) | 133 | self.__init__(refs, execs, contains, extra) |
128 | def __hash__(self): | 134 | def __hash__(self): |
129 | l = (hash(self.refs), hash(self.execs)) | 135 | l = (hash(self.refs), hash(self.execs), hash(self.extra)) |
130 | for c in sorted(self.contains.keys()): | 136 | for c in sorted(self.contains.keys()): |
131 | l = l + (c, hash(self.contains[c])) | 137 | l = l + (c, hash(self.contains[c])) |
132 | return hash(l) | 138 | return hash(l) |
@@ -155,7 +161,7 @@ class CodeParserCache(MultiProcessCache): | |||
155 | # so that an existing cache gets invalidated. Additionally you'll need | 161 | # so that an existing cache gets invalidated. Additionally you'll need |
156 | # to increment __cache_version__ in cache.py in order to ensure that old | 162 | # to increment __cache_version__ in cache.py in order to ensure that old |
157 | # recipe caches don't trigger "Taskhash mismatch" errors. | 163 | # recipe caches don't trigger "Taskhash mismatch" errors. |
158 | CACHE_VERSION = 11 | 164 | CACHE_VERSION = 12 |
159 | 165 | ||
160 | def __init__(self): | 166 | def __init__(self): |
161 | MultiProcessCache.__init__(self) | 167 | MultiProcessCache.__init__(self) |
@@ -169,8 +175,8 @@ class CodeParserCache(MultiProcessCache): | |||
169 | self.pythoncachelines = {} | 175 | self.pythoncachelines = {} |
170 | self.shellcachelines = {} | 176 | self.shellcachelines = {} |
171 | 177 | ||
172 | def newPythonCacheLine(self, refs, execs, contains): | 178 | def newPythonCacheLine(self, refs, execs, contains, extra): |
173 | cacheline = pythonCacheLine(refs, execs, contains) | 179 | cacheline = pythonCacheLine(refs, execs, contains, extra) |
174 | h = hash(cacheline) | 180 | h = hash(cacheline) |
175 | if h in self.pythoncachelines: | 181 | if h in self.pythoncachelines: |
176 | return self.pythoncachelines[h] | 182 | return self.pythoncachelines[h] |
@@ -338,6 +344,7 @@ class PythonParser(): | |||
338 | self.contains = {} | 344 | self.contains = {} |
339 | for i in codeparsercache.pythoncache[h].contains: | 345 | for i in codeparsercache.pythoncache[h].contains: |
340 | self.contains[i] = set(codeparsercache.pythoncache[h].contains[i]) | 346 | self.contains[i] = set(codeparsercache.pythoncache[h].contains[i]) |
347 | self.extra = codeparsercache.pythoncache[h].extra | ||
341 | return | 348 | return |
342 | 349 | ||
343 | if h in codeparsercache.pythoncacheextras: | 350 | if h in codeparsercache.pythoncacheextras: |
@@ -346,6 +353,7 @@ class PythonParser(): | |||
346 | self.contains = {} | 353 | self.contains = {} |
347 | for i in codeparsercache.pythoncacheextras[h].contains: | 354 | for i in codeparsercache.pythoncacheextras[h].contains: |
348 | self.contains[i] = set(codeparsercache.pythoncacheextras[h].contains[i]) | 355 | self.contains[i] = set(codeparsercache.pythoncacheextras[h].contains[i]) |
356 | self.extra = codeparsercache.pythoncacheextras[h].extra | ||
349 | return | 357 | return |
350 | 358 | ||
351 | if fixedhash and not node: | 359 | if fixedhash and not node: |
@@ -364,8 +372,11 @@ class PythonParser(): | |||
364 | self.visit_Call(n) | 372 | self.visit_Call(n) |
365 | 373 | ||
366 | self.execs.update(self.var_execs) | 374 | self.execs.update(self.var_execs) |
375 | self.extra = None | ||
376 | if fixedhash: | ||
377 | self.extra = bbhash(str(node)) | ||
367 | 378 | ||
368 | codeparsercache.pythoncacheextras[h] = codeparsercache.newPythonCacheLine(self.references, self.execs, self.contains) | 379 | codeparsercache.pythoncacheextras[h] = codeparsercache.newPythonCacheLine(self.references, self.execs, self.contains, self.extra) |
369 | 380 | ||
370 | class ShellParser(): | 381 | class ShellParser(): |
371 | def __init__(self, name, log): | 382 | def __init__(self, name, log): |
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index 505f42950f..f672a84451 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py | |||
@@ -293,7 +293,7 @@ def build_dependencies(key, keys, mod_funcs, shelldeps, varflagsexcl, ignored_va | |||
293 | if key in mod_funcs: | 293 | if key in mod_funcs: |
294 | exclusions = set() | 294 | exclusions = set() |
295 | moddep = bb.codeparser.modulecode_deps[key] | 295 | moddep = bb.codeparser.modulecode_deps[key] |
296 | value = handle_contains("", moddep[3], exclusions, d) | 296 | value = handle_contains(moddep[4], moddep[3], exclusions, d) |
297 | return frozenset((moddep[0] | keys & moddep[1]) - ignored_vars), value | 297 | return frozenset((moddep[0] | keys & moddep[1]) - ignored_vars), value |
298 | 298 | ||
299 | if key[-1] == ']': | 299 | if key[-1] == ']': |
diff --git a/bitbake/lib/bb/fetch2/clearcase.py b/bitbake/lib/bb/fetch2/clearcase.py index 1a9c863769..2b3bd70693 100644 --- a/bitbake/lib/bb/fetch2/clearcase.py +++ b/bitbake/lib/bb/fetch2/clearcase.py | |||
@@ -108,7 +108,7 @@ class ClearCase(FetchMethod): | |||
108 | ud.module.replace("/", "."), | 108 | ud.module.replace("/", "."), |
109 | ud.label.replace("/", ".")) | 109 | ud.label.replace("/", ".")) |
110 | 110 | ||
111 | ud.viewname = "%s-view%s" % (ud.identifier, d.getVar("DATETIME", d, True)) | 111 | ud.viewname = "%s-view%s" % (ud.identifier, d.getVar("DATETIME")) |
112 | ud.csname = "%s-config-spec" % (ud.identifier) | 112 | ud.csname = "%s-config-spec" % (ud.identifier) |
113 | ud.ccasedir = os.path.join(d.getVar("DL_DIR"), ud.type) | 113 | ud.ccasedir = os.path.join(d.getVar("DL_DIR"), ud.type) |
114 | ud.viewdir = os.path.join(ud.ccasedir, ud.viewname) | 114 | ud.viewdir = os.path.join(ud.ccasedir, ud.viewname) |
@@ -196,7 +196,7 @@ class ClearCase(FetchMethod): | |||
196 | 196 | ||
197 | def need_update(self, ud, d): | 197 | def need_update(self, ud, d): |
198 | if ("LATEST" in ud.label) or (ud.customspec and "LATEST" in ud.customspec): | 198 | if ("LATEST" in ud.label) or (ud.customspec and "LATEST" in ud.customspec): |
199 | ud.identifier += "-%s" % d.getVar("DATETIME",d, True) | 199 | ud.identifier += "-%s" % d.getVar("DATETIME") |
200 | return True | 200 | return True |
201 | if os.path.exists(ud.localpath): | 201 | if os.path.exists(ud.localpath): |
202 | return False | 202 | return False |