summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/toaster.bbclass50
1 files changed, 15 insertions, 35 deletions
diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
index 004e068de7..1a70f14a92 100644
--- a/meta/classes/toaster.bbclass
+++ b/meta/classes/toaster.bbclass
@@ -112,45 +112,25 @@ def _toaster_load_pkgdatafile(dirpath, filepath):
112 pass # ignore lines without valid key: value pairs 112 pass # ignore lines without valid key: value pairs
113 return pkgdata 113 return pkgdata
114 114
115python toaster_package_dumpdata_setscene() {
116 """
117 Dumps the data created by package_setscene
118 """
119 # replicate variables from the package.bbclass
120 packages = d.getVar('PACKAGES', True)
121 pkgdatadir = d.getVar('PKGDATA_DIR', True)
122 # scan and send data for each package
123 lpkgdata = {}
124 for pkg in packages.split():
125 try:
126 lpkgdata = _toaster_load_pkgdatafile(pkgdatadir + "/runtime/", pkg)
127 except:
128 # these are typically foo-locale which actually point into foo-locale-<language> in runtime-rprovides
129 bb.note("toaster_package_dumpdata_setscene: failed to load pkg information for: %s:%s"%(pkg,sys.exc_info()[0]))
130 # Fire an event containing the pkg data
131 bb.event.fire(bb.event.MetadataEvent("SinglePackageInfo", lpkgdata), d)
132
133}
134
135
136python toaster_package_dumpdata() { 115python toaster_package_dumpdata() {
137 """ 116 """
138 Dumps the data created by emit_pkgdata 117 Dumps the data about the packages created by a recipe
139 """ 118 """
140 # replicate variables from the package.bbclass
141
142 packages = d.getVar('PACKAGES', True)
143 pkgdatadir = d.getVar('PKGDESTWORK', True)
144 119
145 # scan and send data for each package 120 # No need to try and dumpdata if the recipe isn't generating packages
121 if not d.getVar('PACKAGES', True):
122 return
146 123
124 pkgdatadir = d.getVar('PKGDESTWORK', True)
147 lpkgdata = {} 125 lpkgdata = {}
148 for pkg in packages.split(): 126 datadir = os.path.join(pkgdatadir, 'runtime')
149 127
150 lpkgdata = _toaster_load_pkgdatafile(pkgdatadir + "/runtime/", pkg) 128 # scan and send data for each generated package
151 129 for datafile in os.listdir(datadir):
152 # Fire an event containing the pkg data 130 if not datafile.endswith('.packaged'):
153 bb.event.fire(bb.event.MetadataEvent("SinglePackageInfo", lpkgdata), d) 131 lpkgdata = _toaster_load_pkgdatafile(datadir, datafile)
132 # Fire an event containing the pkg data
133 bb.event.fire(bb.event.MetadataEvent("SinglePackageInfo", lpkgdata), d)
154} 134}
155 135
156# 2. Dump output image files information 136# 2. Dump output image files information
@@ -401,8 +381,8 @@ toaster_collect_task_stats[eventmask] = "bb.event.BuildCompleted bb.build.TaskSu
401addhandler toaster_buildhistory_dump 381addhandler toaster_buildhistory_dump
402toaster_buildhistory_dump[eventmask] = "bb.event.BuildCompleted" 382toaster_buildhistory_dump[eventmask] = "bb.event.BuildCompleted"
403 383
404do_packagedata_setscene[postfuncs] += "toaster_package_dumpdata_setscene " 384do_packagedata_setscene[postfuncs] += "toaster_package_dumpdata "
405do_packagedata_setscene[vardepsexclude] += "toaster_package_dumpdata_setscene " 385do_packagedata_setscene[vardepsexclude] += "toaster_package_dumpdata "
406 386
407do_package[postfuncs] += "toaster_package_dumpdata " 387do_package[postfuncs] += "toaster_package_dumpdata "
408do_package[vardepsexclude] += "toaster_package_dumpdata " 388do_package[vardepsexclude] += "toaster_package_dumpdata "