Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame^] | 1 | python 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 | |
| 21 | addhandler packageinfo_handler |
| 22 | packageinfo_handler[eventmask] = "bb.event.RequestPackageInfo" |