summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-08-29 12:57:40 +0100
committerSteve Sakoman <steve@sakoman.com>2024-09-25 05:07:47 -0700
commit0979d14d5487928d0b4655731d932a56fd39d347 (patch)
treeeace1cf97913cd1506563945b22f98a658f0e83f /meta/classes
parent4a64de86917872f8540ba133a8a9f87f55d93082 (diff)
downloadpoky-0979d14d5487928d0b4655731d932a56fd39d347.tar.gz
buildhistory: Simplify intercept call sites and drop SSTATEPOSTINSTFUNC usage
We planned to drop SSTATEPOSTINSTFUNC some time ago with the introduction of postfuncs. Finally get around to doing that which should make the buildhistory code a little more readable. Unfortunately ordering the buildhistory function calls after the sstate ones is difficult without coding that into the sstate class. This patch does that to ensure everything functions as expected until we can find a better way. This is still likely preferable than the generic sstate postfuncs support since the function flow is much more readable. (From OE-Core rev: 466c505b779dec2ba790f4e6cde7fbb35037f4ef) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit c9e2a8fa2f0305ef1247ec405555612326f798f8) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/buildhistory.bbclass39
1 files changed, 19 insertions, 20 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 08970aafea..0b1bd518fe 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -47,11 +47,18 @@ BUILDHISTORY_PUSH_REPO ?= ""
47BUILDHISTORY_TAG ?= "build" 47BUILDHISTORY_TAG ?= "build"
48BUILDHISTORY_PATH_PREFIX_STRIP ?= "" 48BUILDHISTORY_PATH_PREFIX_STRIP ?= ""
49 49
50SSTATEPOSTINSTFUNCS:append = " buildhistory_emit_pkghistory" 50# We want to avoid influencing the signatures of the task so use vardepsexclude
51# We want to avoid influencing the signatures of sstate tasks - first the function itself: 51do_populate_sysroot[postfuncs] += "buildhistory_emit_sysroot"
52sstate_install[vardepsexclude] += "buildhistory_emit_pkghistory" 52do_populate_sysroot_setscene[postfuncs] += "buildhistory_emit_sysroot"
53# then the value added to SSTATEPOSTINSTFUNCS: 53do_populate_sysroot[vardepsexclude] += "buildhistory_emit_sysroot"
54SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory" 54
55do_package[postfuncs] += "buildhistory_list_pkg_files"
56do_package_setscene[postfuncs] += "buildhistory_list_pkg_files"
57do_package[vardepsexclude] += "buildhistory_list_pkg_files"
58
59do_packagedata[postfuncs] += "buildhistory_emit_pkghistory"
60do_packagedata_setscene[postfuncs] += "buildhistory_emit_pkghistory"
61do_packagedata[vardepsexclude] += "buildhistory_emit_pkghistory"
55 62
56# Similarly for our function that gets the output signatures 63# Similarly for our function that gets the output signatures
57SSTATEPOSTUNPACKFUNCS:append = " buildhistory_emit_outputsigs" 64SSTATEPOSTUNPACKFUNCS:append = " buildhistory_emit_outputsigs"
@@ -91,27 +98,15 @@ buildhistory_emit_sysroot() {
91# Write out metadata about this package for comparison when writing future packages 98# Write out metadata about this package for comparison when writing future packages
92# 99#
93python buildhistory_emit_pkghistory() { 100python buildhistory_emit_pkghistory() {
94 if d.getVar('BB_CURRENTTASK') in ['populate_sysroot', 'populate_sysroot_setscene']:
95 bb.build.exec_func("buildhistory_emit_sysroot", d)
96 return 0
97
98 if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
99 return 0
100
101 if d.getVar('BB_CURRENTTASK') in ['package', 'package_setscene']:
102 # Create files-in-<package-name>.txt files containing a list of files of each recipe's package
103 bb.build.exec_func("buildhistory_list_pkg_files", d)
104 return 0
105
106 if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']:
107 return 0
108
109 import re 101 import re
110 import json 102 import json
111 import shlex 103 import shlex
112 import errno 104 import errno
113 import shutil 105 import shutil
114 106
107 if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
108 return 0
109
115 pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE') 110 pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
116 oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE') 111 oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE')
117 112
@@ -621,6 +616,10 @@ buildhistory_list_files_no_owners() {
621} 616}
622 617
623buildhistory_list_pkg_files() { 618buildhistory_list_pkg_files() {
619 if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'package', '1', '0', d)}" = "0" ] ; then
620 return
621 fi
622
624 # Create individual files-in-package for each recipe's package 623 # Create individual files-in-package for each recipe's package
625 pkgdirlist=$(find ${PKGDEST}/* -maxdepth 0 -type d) 624 pkgdirlist=$(find ${PKGDEST}/* -maxdepth 0 -type d)
626 for pkgdir in $pkgdirlist; do 625 for pkgdir in $pkgdirlist; do