Patchwork [bitbake-devel,1/1] bitbake: add description cache into cache_extra

login
register
mail settings
Submitter Shane Wang
Date Jan. 20, 2012, 11:39 a.m.
Message ID <8895391158c0009ef8c76ae667df7c6bf5312661.1327059385.git.shane.wang@intel.com>
Download mbox | patch
Permalink /patch/19823/
State New
Headers show

Comments

Shane Wang - Jan. 20, 2012, 11:39 a.m.
enable bitbake to cache description into the extra cache file and Hob2 will get its value for core-image-foo.

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/cache_extra.py |   13 +++----------
 bitbake/lib/bb/cooker.py      |    2 ++
 2 files changed, 5 insertions(+), 10 deletions(-)
Richard Purdie - Jan. 27, 2012, 4:35 p.m.
On Fri, 2012-01-20 at 19:39 +0800, Shane Wang wrote:
> enable bitbake to cache description into the extra cache file and Hob2 will get its value for core-image-foo.
> 
> Signed-off-by: Shane Wang <shane.wang@intel.com>
> ---
>  bitbake/lib/bb/cache_extra.py |   13 +++----------
>  bitbake/lib/bb/cooker.py      |    2 ++
>  2 files changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/bitbake/lib/bb/cache_extra.py b/bitbake/lib/bb/cache_extra.py
> index 4c8841f..723b97f 100644
> --- a/bitbake/lib/bb/cache_extra.py
> +++ b/bitbake/lib/bb/cache_extra.py
> @@ -36,19 +36,12 @@ class HobRecipeInfo(RecipeInfoCommon):
>      cachefile = "bb_extracache_" + classname +".dat"        
>  
>      def __init__(self, filename, metadata):
> -
> -        self.summary = self.getvar('SUMMARY', metadata)
> -        self.license = self.getvar('LICENSE', metadata)
> -        self.section = self.getvar('SECTION', metadata)
> +        self.description = self.getvar('DESCRIPTION', metadata)
>  
>      @classmethod
>      def init_cacheData(cls, cachedata):
>          # CacheData in Hob RecipeInfo Class
> -        cachedata.summary = {}
> -        cachedata.license = {}
> -        cachedata.section = {}
> +        cachedata.description = {}
>  
>      def add_cacheData(self, cachedata, fn):
> -        cachedata.summary[fn] = self.summary
> -        cachedata.license[fn] = self.license
> -        cachedata.section[fn] = self.section
> +        cachedata.description[fn] = self.description

I think rather than remove the summary/license/section fromhere, we
should remove them from the main cache. There were added there as a
temporary measure before we had multiple cache support and we should
remove them now since they're only used by the hob UI, just like
description.

Cheers,

Richard

Patch

diff --git a/bitbake/lib/bb/cache_extra.py b/bitbake/lib/bb/cache_extra.py
index 4c8841f..723b97f 100644
--- a/bitbake/lib/bb/cache_extra.py
+++ b/bitbake/lib/bb/cache_extra.py
@@ -36,19 +36,12 @@  class HobRecipeInfo(RecipeInfoCommon):
     cachefile = "bb_extracache_" + classname +".dat"        
 
     def __init__(self, filename, metadata):
-
-        self.summary = self.getvar('SUMMARY', metadata)
-        self.license = self.getvar('LICENSE', metadata)
-        self.section = self.getvar('SECTION', metadata)
+        self.description = self.getvar('DESCRIPTION', metadata)
 
     @classmethod
     def init_cacheData(cls, cachedata):
         # CacheData in Hob RecipeInfo Class
-        cachedata.summary = {}
-        cachedata.license = {}
-        cachedata.section = {}
+        cachedata.description = {}
 
     def add_cacheData(self, cachedata, fn):
-        cachedata.summary[fn] = self.summary
-        cachedata.license[fn] = self.license
-        cachedata.section[fn] = self.section
+        cachedata.description[fn] = self.description
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 4197a02..cc5d190 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -466,6 +466,7 @@  class BBCooker:
             summary = self.status.summary[fn]
             lic = self.status.license[fn]
             section = self.status.section[fn]
+            description = self.status.description[fn]
             if pn not in depend_tree["pn"]:
                 depend_tree["pn"][pn] = {}
                 depend_tree["pn"][pn]["filename"] = fn
@@ -473,6 +474,7 @@  class BBCooker:
                 depend_tree["pn"][pn]["summary"] = summary
                 depend_tree["pn"][pn]["license"] = lic
                 depend_tree["pn"][pn]["section"] = section
+                depend_tree["pn"][pn]["description"] = description
 
             if fnid not in seen_fnids:
                 seen_fnids.append(fnid)