summaryrefslogtreecommitdiffstats
path: root/meta/classes/packageinfo.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/packageinfo.bbclass')
-rw-r--r--meta/classes/packageinfo.bbclass22
1 files changed, 22 insertions, 0 deletions
diff --git a/meta/classes/packageinfo.bbclass b/meta/classes/packageinfo.bbclass
new file mode 100644
index 0000000..7d60ace
--- /dev/null
+++ b/meta/classes/packageinfo.bbclass
@@ -0,0 +1,22 @@
1python packageinfo_handler () {
2 import oe.packagedata
3 pkginfolist = []
4
5 pkgdata_dir = e.data.getVar("PKGDATA_DIR", True) + '/runtime/'
6 if os.path.exists(pkgdata_dir):
7 for root, dirs, files in os.walk(pkgdata_dir):
8 for pkgname in files:
9 if pkgname.endswith('.packaged'):
10 pkgname = pkgname[:-9]
11 pkgdatafile = root + pkgname
12 try:
13 sdata = oe.packagedata.read_pkgdatafile(pkgdatafile)
14 sdata['PKG'] = pkgname
15 pkginfolist.append(sdata)
16 except Exception as e:
17 bb.warn("Failed to read pkgdata file %s: %s: %s" % (pkgdatafile, e.__class__, str(e)))
18 bb.event.fire(bb.event.PackageInfo(pkginfolist), e.data)
19}
20
21addhandler packageinfo_handler
22packageinfo_handler[eventmask] = "bb.event.RequestPackageInfo"