summaryrefslogtreecommitdiff
path: root/meta/classes/buildhistory.bbclass
diff options
context:
space:
mode:
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"
# 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):