]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
buildinfohelper: add provides info to the db
authorEd Bartosh <ed.bartosh@linux.intel.com>
Fri, 8 Jan 2016 11:17:19 +0000 (11:17 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 8 Jan 2016 23:03:48 +0000 (23:03 +0000)
Added new entries to Provides model and link them to
Recipe_Dependency using 'via' field.

This data will be used by Toaster UI to show 'Provides:'
information for the recipes.

[YOCTO #6169]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/ui/buildinfohelper.py

index cba016528c5a630fddcca4a5fc30ed4d53197788..0cb6f684f93f42a9800ba1d7a8185f72acf990e4 100644 (file)
@@ -41,7 +41,7 @@ from orm.models import Target_Image_File, BuildArtifact
 from orm.models import Variable, VariableHistory
 from orm.models import Package, Package_File, Target_Installed_Package, Target_File
 from orm.models import Task_Dependency, Package_Dependency
-from orm.models import Recipe_Dependency
+from orm.models import Recipe_Dependency, Provides
 
 from orm.models import Project
 from bldcontrol.models import BuildEnvironment, BuildRequest
@@ -1268,15 +1268,20 @@ class BuildInfoHelper(object):
            for dep in event._depgraph['depends'][recipe]:
                 if dep in assume_provided:
                     continue
+                via = None
                 if dep in event._depgraph['providermap']:
-                    dep = event._depgraph['providermap'][dep][0]
-                if dep in self.internal_state['recipes']:
+                    deprecipe = event._depgraph['providermap'][dep][0]
+                    dependency = self.internal_state['recipes'][deprecipe]
+                    via = Provides.objects.get_or_create(name=dep,
+                                                         recipe=dependency)[0]
+                elif dep in self.internal_state['recipes']:
                     dependency = self.internal_state['recipes'][dep]
                 else:
                     errormsg += "  stpd: KeyError saving recipe dependency for %s, %s \n" % (recipe, dep)
                     continue
                 recipe_dep = Recipe_Dependency(recipe=target,
                                                depends_on=dependency,
+                                               via=via,
                                                dep_type=Recipe_Dependency.TYPE_DEPENDS)
                 recipedeps_objects.append(recipe_dep)