summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2013-09-18 13:15:50 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-22 12:19:44 +0100
commit0c51d610e1bdb16ec96c29ec2b92de922f67b009 (patch)
tree41034a42a5129b782e0f6d5a26fa2091b4475699
parent5ee82d404897c6af8d7cdfc728c6ba007bfd76b7 (diff)
downloadpoky-0c51d610e1bdb16ec96c29ec2b92de922f67b009.tar.gz
bitbake: bitbake: cooker: get extra information from recipe cache
The loaded cache modules may add extra attributes to the recipecache, that will be populated by the cache classes required by the UI. These attributes will be used by the UI to display relevant information. Adds cachefields cache class field to specify for each cache class which attributes will be set in the recipecache. Adds code to automatically expand depends tree with the fields exported by the extra cache class. Fixes a cache field name in the HOB UI. (Bitbake rev: 47c171005fb3803d936e65fcd4436c643883ae16) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/cache_extra.py6
-rw-r--r--bitbake/lib/bb/cooker.py50
-rw-r--r--bitbake/lib/bb/ui/crumbs/hoblistmodel.py2
3 files changed, 36 insertions, 22 deletions
diff --git a/bitbake/lib/bb/cache_extra.py b/bitbake/lib/bb/cache_extra.py
index 9e38a439e8..83f4959d6c 100644
--- a/bitbake/lib/bb/cache_extra.py
+++ b/bitbake/lib/bb/cache_extra.py
@@ -35,6 +35,12 @@ class HobRecipeInfo(RecipeInfoCommon):
35 # such as (bb_cache.dat, bb_extracache_hob.dat) 35 # such as (bb_cache.dat, bb_extracache_hob.dat)
36 cachefile = "bb_extracache_" + classname +".dat" 36 cachefile = "bb_extracache_" + classname +".dat"
37 37
38 # override this member with the list of extra cache fields
39 # that this class will provide
40 cachefields = ['summary', 'license', 'section',
41 'description', 'homepage', 'bugtracker',
42 'prevision', 'files_info']
43
38 def __init__(self, filename, metadata): 44 def __init__(self, filename, metadata):
39 45
40 self.summary = self.getvar('SUMMARY', metadata) 46 self.summary = self.getvar('SUMMARY', metadata)
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index dd45ae8173..fafa518911 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -481,6 +481,19 @@ class BBCooker:
481 depend_tree["pn"][pn] = {} 481 depend_tree["pn"][pn] = {}
482 depend_tree["pn"][pn]["filename"] = fn 482 depend_tree["pn"][pn]["filename"] = fn
483 depend_tree["pn"][pn]["version"] = version 483 depend_tree["pn"][pn]["version"] = version
484
485 # if we have extra caches, list all attributes they bring in
486 extra_info = []
487 for cache_class in self.caches_array:
488 if type(cache_class) is type and issubclass(cache_class, bb.cache.RecipeInfoCommon) and hasattr(cache_class, 'cachefields'):
489 cachefields = getattr(cache_class, 'cachefields', [])
490 extra_info = extra_info + cachefields
491
492 # for all attributes stored, add them to the dependency tree
493 for ei in extra_info:
494 depend_tree["pn"][pn][ei] = vars(self.recipecache)[ei][fn]
495
496
484 for dep in rq.rqdata.runq_depends[task]: 497 for dep in rq.rqdata.runq_depends[task]:
485 depfn = taskdata.fn_index[rq.rqdata.runq_fnid[dep]] 498 depfn = taskdata.fn_index[rq.rqdata.runq_fnid[dep]]
486 deppn = self.recipecache.pkg_fn[depfn] 499 deppn = self.recipecache.pkg_fn[depfn]
@@ -543,35 +556,30 @@ class BBCooker:
543 depend_tree["rdepends-pkg"] = {} 556 depend_tree["rdepends-pkg"] = {}
544 depend_tree["rrecs-pkg"] = {} 557 depend_tree["rrecs-pkg"] = {}
545 558
559 # if we have extra caches, list all attributes they bring in
560 extra_info = []
561 for cache_class in self.caches_array:
562 if type(cache_class) is type and issubclass(cache_class, bb.cache.RecipeInfoCommon) and hasattr(cache_class, 'cachefields'):
563 cachefields = getattr(cache_class, 'cachefields', [])
564 extra_info = extra_info + cachefields
565
546 for task in xrange(len(tasks_fnid)): 566 for task in xrange(len(tasks_fnid)):
547 fnid = tasks_fnid[task] 567 fnid = tasks_fnid[task]
548 fn = taskdata.fn_index[fnid] 568 fn = taskdata.fn_index[fnid]
549 pn = self.recipecache.pkg_fn[fn] 569 pn = self.recipecache.pkg_fn[fn]
550 version = "%s:%s-%s" % self.recipecache.pkg_pepvpr[fn] 570
551 summary = self.recipecache.summary[fn]
552 lic = self.recipecache.license[fn]
553 section = self.recipecache.section[fn]
554 description = self.recipecache.description[fn]
555 homepage = self.recipecache.homepage[fn]
556 bugtracker = self.recipecache.bugtracker[fn]
557 files_info = self.recipecache.files_info[fn]
558 rdepends = self.recipecache.rundeps[fn]
559 rrecs = self.recipecache.runrecs[fn]
560 prevision = self.recipecache.prevision[fn]
561 inherits = self.recipecache.inherits.get(fn, None)
562 if pn not in depend_tree["pn"]: 571 if pn not in depend_tree["pn"]:
563 depend_tree["pn"][pn] = {} 572 depend_tree["pn"][pn] = {}
564 depend_tree["pn"][pn]["filename"] = fn 573 depend_tree["pn"][pn]["filename"] = fn
574 version = "%s:%s-%s" % self.recipecache.pkg_pepvpr[fn]
565 depend_tree["pn"][pn]["version"] = version 575 depend_tree["pn"][pn]["version"] = version
566 depend_tree["pn"][pn]["summary"] = summary 576 rdepends = self.recipecache.rundeps[fn]
567 depend_tree["pn"][pn]["license"] = lic 577 rrecs = self.recipecache.runrecs[fn]
568 depend_tree["pn"][pn]["section"] = section 578 depend_tree["pn"][pn]["inherits"] = self.recipecache.inherits.get(fn, None)
569 depend_tree["pn"][pn]["description"] = description 579
570 depend_tree["pn"][pn]["inherits"] = inherits 580 # for all extra attributes stored, add them to the dependency tree
571 depend_tree["pn"][pn]["homepage"] = homepage 581 for ei in extra_info:
572 depend_tree["pn"][pn]["bugtracker"] = bugtracker 582 depend_tree["pn"][pn][ei] = vars(self.recipecache)[ei][fn]
573 depend_tree["pn"][pn]["files_info"] = files_info
574 depend_tree["pn"][pn]["revision"] = prevision
575 583
576 if fnid not in seen_fnids: 584 if fnid not in seen_fnids:
577 seen_fnids.append(fnid) 585 seen_fnids.append(fnid)
diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
index 74d335c88b..b4d2a621b7 100644
--- a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
+++ b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
@@ -690,7 +690,7 @@ class RecipeListModel(gtk.ListStore):
690 inherits = event_model["pn"][item]["inherits"] 690 inherits = event_model["pn"][item]["inherits"]
691 summary = event_model["pn"][item]["summary"] 691 summary = event_model["pn"][item]["summary"]
692 version = event_model["pn"][item]["version"] 692 version = event_model["pn"][item]["version"]
693 revision = event_model["pn"][item]["revision"] 693 revision = event_model["pn"][item]["prevision"]
694 homepage = event_model["pn"][item]["homepage"] 694 homepage = event_model["pn"][item]["homepage"]
695 bugtracker = event_model["pn"][item]["bugtracker"] 695 bugtracker = event_model["pn"][item]["bugtracker"]
696 filename = event_model["pn"][item]["filename"] 696 filename = event_model["pn"][item]["filename"]