[bitbake-devel] [PATCH 4/7] bitbake: cooker: add extra recipe information

Richard Purdie richard.purdie at linuxfoundation.org
Mon Sep 16 14:10:56 UTC 2013


On Mon, 2013-09-16 at 14:33 +0100, Alex DAMIAN wrote:
> From: Alexandru DAMIAN <alexandru.damian at intel.com>
> 
> Adding in the extra recipe information when creating
> the dependency tree information.
> 
> This works in server-mode because the HOB extra_cache
> is already enabled. In normal mode, it will do nothing
> with no performance impact.
> 
> Signed-off-by: Alexandru DAMIAN <alexandru.damian at intel.com>
> ---
>  bitbake/lib/bb/cooker.py | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
> index 68a3c01..cb0e3e5 100644
> --- a/bitbake/lib/bb/cooker.py
> +++ b/bitbake/lib/bb/cooker.py
> @@ -439,6 +439,29 @@ class BBCooker:
>                  depend_tree["pn"][pn] = {}
>                  depend_tree["pn"][pn]["filename"] = fn
>                  depend_tree["pn"][pn]["version"] = version
> +
> +                # This data is needed for webhob;
> +                # it's here if the bitbake runs in server mode
> +                try:
> +                    summary = self.recipecache.summary[fn]
> +                    lic = self.recipecache.license[fn]
> +                    section = self.recipecache.section[fn]
> +                    description = self.recipecache.description[fn]
> +                    homepage = self.recipecache.homepage[fn]
> +                    bugtracker = self.recipecache.bugtracker[fn]
> +                    inherits = self.recipecache.inherits.get(fn, None)
> +                    depend_tree["pn"][pn]["filename"] = fn
> +                    depend_tree["pn"][pn]["version"] = version
> +                    depend_tree["pn"][pn]["summary"] = summary
> +                    depend_tree["pn"][pn]["license"] = lic
> +                    depend_tree["pn"][pn]["section"] = section
> +                    depend_tree["pn"][pn]["description"] = description
> +                    depend_tree["pn"][pn]["inherits"] = inherits
> +                    depend_tree["pn"][pn]["homepage"] = homepage
> +                    depend_tree["pn"][pn]["bugtracker"] = bugtracker
> +                except:
> +                    pass
> +
>              for dep in rq.rqdata.runq_depends[task]:
>                  depfn = taskdata.fn_index[rq.rqdata.runq_fnid[dep]]
>                  deppn = self.recipecache.pkg_fn[depfn]

This is horrible, please try and do something like:

diff --git a/bitbake/lib/bb/cache_extra.py b/bitbake/lib/bb/cache_extra.py
index 9e38a43..041ba0e 100644
--- a/bitbake/lib/bb/cache_extra.py
+++ b/bitbake/lib/bb/cache_extra.py
@@ -67,3 +67,6 @@ class HobRecipeInfo(RecipeInfoCommon):
         cachedata.bugtracker[fn] = self.bugtracker
         cachedata.prevision[fn] = self.prevision
         cachedata.files_info[fn] = self.files_info
+
+    @staticmethod
+    def addDepTreePackageInfo(xxx)
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 2c8d4dc..84d62e5 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -485,6 +485,10 @@ class BBCooker:
                         depend_tree["packages"][package]["filename"] = fn
                         depend_tree["packages"][package]["version"] = version
 
+                        for extracache in self.cooker.caches_array:
+                            if <executable function>:
+                                 <function>(depend_tree["packages"][package])
+
         return depend_tree

so the extra cache info is added as a staticmethod function in the extra
cache info file which generated the data. You might as well fix the
hardcoding in the following function marked with:

     ######## WARNING : this function requires cache_extra to be enabled ########

to use this approach too whilst you're doing this.

Thanks,

Richard




More information about the bitbake-devel mailing list