summaryrefslogtreecommitdiffstats
path: root/meta/classes/buildhistory.bbclass
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2015-11-25 10:30:30 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-01 21:32:01 +0000
commiteded9c26b379baefdc9ad49f856615b6e7e36760 (patch)
tree177fb0d34429762b0a8798f5b68aef098465d83d /meta/classes/buildhistory.bbclass
parentd95df11131b60933ce82b7ac96fd2dc2ebc5e1f6 (diff)
downloadpoky-eded9c26b379baefdc9ad49f856615b6e7e36760.tar.gz
buildhistory.bbclass: support extending the content of the build history
The idea behind the implementation of Yocto #8138 was that an additional class can write additional files in the recipe directories, for example by hooking into the functions of buildhistory.bbclass or by implementing its own SSTATEPOSTINSTFUNCS function. However, when these additional files get created before buildhistory_emit_pkghistory(), they get removed again by that function because it contains code which removes everything it does not know about. The reason for that is that these unknown items are probably obsolete. This logic is the reason why the additional "kconfig" file from buildhistory-extra.bbclass never showed up in the final build history. To fix this, the hard-coded list of known files in buildhistory_emit_pkghistory() must be turned into a variable which derived classes can extend. (From OE-Core rev: 97f77ea3313b0d79ae4a6090672a2a9344282262) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/buildhistory.bbclass')
-rw-r--r--meta/classes/buildhistory.bbclass13
1 files changed, 12 insertions, 1 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 729dcd449d..6023e5d9a5 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -23,6 +23,16 @@ sstate_install[vardepsexclude] += "buildhistory_emit_pkghistory"
23# then the value added to SSTATEPOSTINSTFUNCS: 23# then the value added to SSTATEPOSTINSTFUNCS:
24SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory" 24SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory"
25 25
26# All items excepts those listed here will be removed from a recipe's
27# build history directory by buildhistory_emit_pkghistory(). This is
28# necessary because some of these items (package directories, files that
29# we no longer emit) might be obsolete.
30#
31# When extending build history, derive your class from buildhistory.bbclass
32# and extend this list here with the additional files created by the derived
33# class.
34BUILDHISTORY_PRESERVE = "latest latest_srcrev"
35
26# 36#
27# Write out metadata about this package for comparison when writing future packages 37# Write out metadata about this package for comparison when writing future packages
28# 38#
@@ -165,12 +175,13 @@ python buildhistory_emit_pkghistory() {
165 raise 175 raise
166 176
167 packagelist = packages.split() 177 packagelist = packages.split()
178 preserve = d.getVar('BUILDHISTORY_PRESERVE', True).split()
168 if not os.path.exists(pkghistdir): 179 if not os.path.exists(pkghistdir):
169 bb.utils.mkdirhier(pkghistdir) 180 bb.utils.mkdirhier(pkghistdir)
170 else: 181 else:
171 # Remove files for packages that no longer exist 182 # Remove files for packages that no longer exist
172 for item in os.listdir(pkghistdir): 183 for item in os.listdir(pkghistdir):
173 if item != "latest" and item != "latest_srcrev": 184 if item not in preserve:
174 if item not in packagelist: 185 if item not in packagelist:
175 itempath = os.path.join(pkghistdir, item) 186 itempath = os.path.join(pkghistdir, item)
176 if os.path.isdir(itempath): 187 if os.path.isdir(itempath):