diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2015-11-25 10:30:30 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-01 21:07:20 +0000 |
commit | 97f77ea3313b0d79ae4a6090672a2a9344282262 (patch) | |
tree | ee055bcf8732ee4a3b5fbdab144a53acfeb74da6 | |
parent | a58e8e164b888a6e4747ef62a7a43825c4f47c32 (diff) | |
download | openembedded-core-97f77ea3313b0d79ae4a6090672a2a9344282262.tar.gz openembedded-core-97f77ea3313b0d79ae4a6090672a2a9344282262.tar.bz2 openembedded-core-97f77ea3313b0d79ae4a6090672a2a9344282262.zip |
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.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r-- | meta/classes/buildhistory.bbclass | 13 |
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" # then the value added to SSTATEPOSTINSTFUNCS: SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory" +# All items excepts those listed here will be removed from a recipe's +# build history directory by buildhistory_emit_pkghistory(). This is +# necessary because some of these items (package directories, files that +# we no longer emit) might be obsolete. +# +# When extending build history, derive your class from buildhistory.bbclass +# and extend this list here with the additional files created by the derived +# class. +BUILDHISTORY_PRESERVE = "latest latest_srcrev" + # # Write out metadata about this package for comparison when writing future packages # @@ -165,12 +175,13 @@ python buildhistory_emit_pkghistory() { raise packagelist = packages.split() + preserve = d.getVar('BUILDHISTORY_PRESERVE', True).split() if not os.path.exists(pkghistdir): bb.utils.mkdirhier(pkghistdir) else: # Remove files for packages that no longer exist for item in os.listdir(pkghistdir): - if item != "latest" and item != "latest_srcrev": + if item not in preserve: if item not in packagelist: itempath = os.path.join(pkghistdir, item) if os.path.isdir(itempath): |