diff options
-rw-r--r-- | meta/classes/toaster.bbclass | 50 |
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 | ||
115 | python 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 | |||
136 | python toaster_package_dumpdata() { | 115 | python 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 | |||
401 | addhandler toaster_buildhistory_dump | 381 | addhandler toaster_buildhistory_dump |
402 | toaster_buildhistory_dump[eventmask] = "bb.event.BuildCompleted" | 382 | toaster_buildhistory_dump[eventmask] = "bb.event.BuildCompleted" |
403 | 383 | ||
404 | do_packagedata_setscene[postfuncs] += "toaster_package_dumpdata_setscene " | 384 | do_packagedata_setscene[postfuncs] += "toaster_package_dumpdata " |
405 | do_packagedata_setscene[vardepsexclude] += "toaster_package_dumpdata_setscene " | 385 | do_packagedata_setscene[vardepsexclude] += "toaster_package_dumpdata " |
406 | 386 | ||
407 | do_package[postfuncs] += "toaster_package_dumpdata " | 387 | do_package[postfuncs] += "toaster_package_dumpdata " |
408 | do_package[vardepsexclude] += "toaster_package_dumpdata " | 388 | do_package[vardepsexclude] += "toaster_package_dumpdata " |