summaryrefslogtreecommitdiffstats
path: root/meta/classes/buildhistory.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/buildhistory.bbclass')
-rw-r--r--meta/classes/buildhistory.bbclass28
1 files changed, 28 insertions, 0 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 4fc19a0fc2..f543bb73d6 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -47,6 +47,11 @@ sstate_install[vardepsexclude] += "buildhistory_emit_pkghistory"
47# then the value added to SSTATEPOSTINSTFUNCS: 47# then the value added to SSTATEPOSTINSTFUNCS:
48SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory" 48SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory"
49 49
50# Similarly for our function that gets the output signatures
51SSTATEPOSTUNPACKFUNCS_append = " buildhistory_emit_outputsigs"
52sstate_installpkgdir[vardepsexclude] += "buildhistory_emit_outputsigs"
53SSTATEPOSTUNPACKFUNCS[vardepvalueexclude] .= "| buildhistory_emit_outputsigs"
54
50# All items excepts those listed here will be removed from a recipe's 55# All items excepts those listed here will be removed from a recipe's
51# build history directory by buildhistory_emit_pkghistory(). This is 56# build history directory by buildhistory_emit_pkghistory(). This is
52# necessary because some of these items (package directories, files that 57# necessary because some of these items (package directories, files that
@@ -292,6 +297,29 @@ python buildhistory_emit_pkghistory() {
292 bb.build.exec_func("buildhistory_list_pkg_files", d) 297 bb.build.exec_func("buildhistory_list_pkg_files", d)
293} 298}
294 299
300python buildhistory_emit_outputsigs() {
301 if not "task" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
302 return
303
304 taskoutdir = os.path.join(d.getVar('BUILDHISTORY_DIR'), 'task', 'output')
305 bb.utils.mkdirhier(taskoutdir)
306 currenttask = d.getVar('BB_CURRENTTASK')
307 pn = d.getVar('PN')
308 taskfile = os.path.join(taskoutdir, '%s.%s' % (pn, currenttask))
309
310 cwd = os.getcwd()
311 filesigs = {}
312 for root, _, files in os.walk(cwd):
313 for fname in files:
314 if fname == 'fixmepath':
315 continue
316 fullpath = os.path.join(root, fname)
317 filesigs[os.path.relpath(fullpath, cwd)] = bb.utils.sha256_file(fullpath)
318 with open(taskfile, 'w') as f:
319 for fpath, fsig in sorted(filesigs.items(), key=lambda item: item[0]):
320 f.write('%s %s\n' % (fpath, fsig))
321}
322
295 323
296def write_recipehistory(rcpinfo, d): 324def write_recipehistory(rcpinfo, d):
297 bb.debug(2, "Writing recipe history") 325 bb.debug(2, "Writing recipe history")