summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/sstatesig.py
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2021-05-27 13:18:35 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-06-03 23:09:41 +0100
commitba491952ee8b6183251f37e62485fc49b6e87ea5 (patch)
treeb651b6cb0d2e0e1804b8d09aea0a8d4f39b627ea /meta/lib/oe/sstatesig.py
parentc26ea554a7613d4561712fdd3060c7de7c0584d4 (diff)
downloadpoky-ba491952ee8b6183251f37e62485fc49b6e87ea5.tar.gz
classes/buildhistory: Add option to strip path prefix
Adds an option to strip a prefix from the paths reported in buildhistory. This makes it easier to compare task signatures in the build history when the builds were done from different directories. (From OE-Core rev: 194e7a29212c4a29222730f47d3133dfe92447c1) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/sstatesig.py')
-rw-r--r--meta/lib/oe/sstatesig.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index e86a09b332..47f3ca4efb 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -248,13 +248,24 @@ class SignatureGeneratorOEBasicHashMixIn(object):
248 f.write(' "\n') 248 f.write(' "\n')
249 f.write('SIGGEN_LOCKEDSIGS_TYPES_%s = "%s"' % (self.machine, " ".join(l))) 249 f.write('SIGGEN_LOCKEDSIGS_TYPES_%s = "%s"' % (self.machine, " ".join(l)))
250 250
251 def dump_siglist(self, sigfile): 251 def dump_siglist(self, sigfile, path_prefix_strip=None):
252 def strip_fn(fn):
253 nonlocal path_prefix_strip
254 if not path_prefix_strip:
255 return fn
256
257 fn_exp = fn.split(":")
258 if fn_exp[-1].startswith(path_prefix_strip):
259 fn_exp[-1] = fn_exp[-1][len(path_prefix_strip):]
260
261 return ":".join(fn_exp)
262
252 with open(sigfile, "w") as f: 263 with open(sigfile, "w") as f:
253 tasks = [] 264 tasks = []
254 for taskitem in self.taskhash: 265 for taskitem in self.taskhash:
255 (fn, task) = taskitem.rsplit(":", 1) 266 (fn, task) = taskitem.rsplit(":", 1)
256 pn = self.lockedpnmap[fn] 267 pn = self.lockedpnmap[fn]
257 tasks.append((pn, task, fn, self.taskhash[taskitem])) 268 tasks.append((pn, task, strip_fn(fn), self.taskhash[taskitem]))
258 for (pn, task, fn, taskhash) in sorted(tasks): 269 for (pn, task, fn, taskhash) in sorted(tasks):
259 f.write('%s:%s %s %s\n' % (pn, task, fn, taskhash)) 270 f.write('%s:%s %s %s\n' % (pn, task, fn, taskhash))
260 271