summaryrefslogtreecommitdiffstats
path: root/meta/classes/buildhistory.bbclass
diff options
context:
space:
mode:
authorMikko Rapeli <mikko.rapeli@bmw.de>2017-03-21 12:53:13 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-22 11:35:22 +0000
commitc52fe3a77a56df7d5b647bc91007211d8899956a (patch)
tree4cd4ef301d1d75d738bb0f34f0d83580e19d4751 /meta/classes/buildhistory.bbclass
parent11aa39028867d356d37291c2d9ca492f7cdf0795 (diff)
downloadpoky-c52fe3a77a56df7d5b647bc91007211d8899956a.tar.gz
buildhistory.bbclass: add layer name to source recipe data
It is useful to know which layer provided a given recipe and its binary packages. Many projects combine a number of layers and some of them also provide same recipe names in which case bitbake can prioritize between them. buildhistory can record the decision by saving the layer from where the recipe was taken from. Also, if a project is split to sub projects which maintain recipes in different meta layers, then meta layer specific summaries of e.g. disk usage can be calculated if source recipes meta layer name is recorded for example in buildhistory. If source layer is not in build history, then layer providing the recipe can be exported from build environment using 'bitbake-layers show-recipes', but it takes a long time to execute since all recipes are parsed again and requires full source tree with correct build configuration. This patch exports the name of layer as configured in BBFILE_COLLECTIONS append of its layer.conf. 'bitbake-layers show-recipes' exports the meta layers directory path name. For several open source layers these are different, e.g. meta-openembedded/meta-perl/conf/layer.conf is perl-layer, poky/meta/conf/layer.conf is core, poky/meta-skeleton/conf/layer.conf is skeleton etc. (From OE-Core rev: d8e59d1f840e4282859ad14397d1c06516b8eb11) Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de> 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.bbclass4
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index bf5789e203..109b375059 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -86,6 +86,7 @@ python buildhistory_emit_pkghistory() {
86 self.depends = "" 86 self.depends = ""
87 self.packages = "" 87 self.packages = ""
88 self.srcrev = "" 88 self.srcrev = ""
89 self.layer = ""
89 90
90 91
91 class PackageInfo: 92 class PackageInfo:
@@ -186,6 +187,7 @@ python buildhistory_emit_pkghistory() {
186 pe = d.getVar('PE') or "0" 187 pe = d.getVar('PE') or "0"
187 pv = d.getVar('PV') 188 pv = d.getVar('PV')
188 pr = d.getVar('PR') 189 pr = d.getVar('PR')
190 layer = bb.utils.get_file_layer(d.getVar('FILE', True), d)
189 191
190 pkgdata_dir = d.getVar('PKGDATA_DIR') 192 pkgdata_dir = d.getVar('PKGDATA_DIR')
191 packages = "" 193 packages = ""
@@ -225,6 +227,7 @@ python buildhistory_emit_pkghistory() {
225 rcpinfo.pr = pr 227 rcpinfo.pr = pr
226 rcpinfo.depends = sortlist(oe.utils.squashspaces(d.getVar('DEPENDS') or "")) 228 rcpinfo.depends = sortlist(oe.utils.squashspaces(d.getVar('DEPENDS') or ""))
227 rcpinfo.packages = packages 229 rcpinfo.packages = packages
230 rcpinfo.layer = layer
228 write_recipehistory(rcpinfo, d) 231 write_recipehistory(rcpinfo, d)
229 232
230 pkgdest = d.getVar('PKGDEST') 233 pkgdest = d.getVar('PKGDEST')
@@ -303,6 +306,7 @@ def write_recipehistory(rcpinfo, d):
303 f.write(u"PR = %s\n" % rcpinfo.pr) 306 f.write(u"PR = %s\n" % rcpinfo.pr)
304 f.write(u"DEPENDS = %s\n" % rcpinfo.depends) 307 f.write(u"DEPENDS = %s\n" % rcpinfo.depends)
305 f.write(u"PACKAGES = %s\n" % rcpinfo.packages) 308 f.write(u"PACKAGES = %s\n" % rcpinfo.packages)
309 f.write(u"LAYER = %s\n" % rcpinfo.layer)
306 310
307 311
308def write_pkghistory(pkginfo, d): 312def write_pkghistory(pkginfo, d):