blob: 7d60ace1dcd18b1ed0bd35c57e2be543766bb478 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001python 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"