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.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):