diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2021-05-27 13:18:35 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-06-03 23:09:18 +0100 |
commit | 194e7a29212c4a29222730f47d3133dfe92447c1 (patch) | |
tree | 97376bd527d25b6742570c0790251b6493ce5fbd /meta/lib | |
parent | edaf8ff278fc96b122c4fc3266b63856e3350f4c (diff) | |
download | openembedded-core-contrib-194e7a29212c4a29222730f47d3133dfe92447c1.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.
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/sstatesig.py | 15 |
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): f.write(' "\n') f.write('SIGGEN_LOCKEDSIGS_TYPES_%s = "%s"' % (self.machine, " ".join(l))) - def dump_siglist(self, sigfile): + def dump_siglist(self, sigfile, path_prefix_strip=None): + def strip_fn(fn): + nonlocal path_prefix_strip + if not path_prefix_strip: + return fn + + fn_exp = fn.split(":") + if fn_exp[-1].startswith(path_prefix_strip): + fn_exp[-1] = fn_exp[-1][len(path_prefix_strip):] + + return ":".join(fn_exp) + with open(sigfile, "w") as f: tasks = [] for taskitem in self.taskhash: (fn, task) = taskitem.rsplit(":", 1) pn = self.lockedpnmap[fn] - tasks.append((pn, task, fn, self.taskhash[taskitem])) + tasks.append((pn, task, strip_fn(fn), self.taskhash[taskitem])) for (pn, task, fn, taskhash) in sorted(tasks): f.write('%s:%s %s %s\n' % (pn, task, fn, taskhash)) |