Patchwork [1/2] toaster.bbclass: save original package name

login
register
mail settings
Submitter Alexandru DAMIAN
Date Jan. 29, 2014, 5:21 p.m.
Message ID <1391016111-7447-1-git-send-email-alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/66031/
State New
Headers show

Comments

Alexandru DAMIAN - Jan. 29, 2014, 5:21 p.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

If we can get the original package name when reading
package infos in toaster.bbclass, we save it for proper
referincing in the toater ui.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 meta/classes/toaster.bbclass | 4 ++++
 1 file changed, 4 insertions(+)

Patch

diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
index 7c404b9..eed30d4 100644
--- a/meta/classes/toaster.bbclass
+++ b/meta/classes/toaster.bbclass
@@ -94,11 +94,15 @@  python toaster_layerinfo_dumpdata() {
 
 def _toaster_load_pkgdatafile(dirpath, filepath):
     import json
+    import re
     pkgdata = {}
     with open(os.path.join(dirpath, filepath), "r") as fin:
         for line in fin:
             try:
                 kn, kv = line.strip().split(": ", 1)
+                m = re.match(r"^PKG_([^A-Z:]*)", kn)
+                if m:
+                    pkgdata['OPKGN'] = m.group(1)
                 kn = "_".join([x for x in kn.split("_") if x.isupper()])
                 pkgdata[kn] = kv.strip()
                 if kn == 'FILES_INFO':