aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex/views.py
diff options
context:
space:
mode:
authorAmanda Brindle <amanda.r.brindle@intel.com>2017-12-15 13:06:53 -0800
committerPaul Eggleton <paul.eggleton@linux.intel.com>2017-12-18 09:01:29 +1300
commit51e83c8d31449eb314a9d7e93545f78de2898d87 (patch)
tree26ea280d2b70c2267032ec418a75cc288331b151 /layerindex/views.py
parenta64bfed81b3827503ff825090f1fb4b94e1cd9bd (diff)
downloadopenembedded-core-contrib-51e83c8d31449eb314a9d7e93545f78de2898d87.tar.gz
update_layer.py: Save and show recipe dependencies
Added a model for the PACKAGECONFIG variable, which has a one to many relationship with the Recipe model. Added models for static build dependencies and dynamic build dependencies, both of which have a many to many relationship with the Recipe model. These objects are created in update_layer.py and are displayed on the Recipe detail page. Added a depends search option for recipes, allowing users to search for recipes that depend on any particular recipe. Use "depends:recipename" in the recipe search to activate this. Fixes [YOCTO #12129] Fixes [YOCTO #11415] Signed-off-by: Amanda Brindle <amanda.r.brindle@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex/views.py')
-rw-r--r--layerindex/views.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/layerindex/views.py b/layerindex/views.py
index 414c770451..ccb85b80a2 100644
--- a/layerindex/views.py
+++ b/layerindex/views.py
@@ -10,7 +10,7 @@ from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidde
from django.core.urlresolvers import reverse, reverse_lazy, resolve
from django.core.exceptions import PermissionDenied
from django.template import RequestContext
-from layerindex.models import Branch, LayerItem, LayerMaintainer, LayerBranch, LayerDependency, LayerNote, Update, LayerUpdate, Recipe, Machine, Distro, BBClass, BBAppend, RecipeChange, RecipeChangeset, ClassicRecipe
+from layerindex.models import Branch, LayerItem, LayerMaintainer, LayerBranch, LayerDependency, LayerNote, Update, LayerUpdate, Recipe, Machine, Distro, BBClass, BBAppend, RecipeChange, RecipeChangeset, ClassicRecipe, StaticBuildDep, DynamicBuildDep
from datetime import datetime
from django.views.generic import TemplateView, DetailView, ListView
from django.views.generic.edit import CreateView, DeleteView, UpdateView
@@ -428,6 +428,19 @@ class RecipeSearchView(ListView):
for item in query_items:
if item.startswith('inherits:'):
inherits.append(item.split(':')[1])
+
+ # support searches by build dependencies
+ elif item.startswith('depends:'):
+ depsearch = item.split(':')[1]
+ qobj = Q(pk__in=[])
+ static_build_dependencies = StaticBuildDep.objects.filter(name=depsearch).first()
+ dynamic_build_dependencies = DynamicBuildDep.objects.filter(name=depsearch).first()
+ if static_build_dependencies:
+ qobj |= Q(staticbuilddep=static_build_dependencies)
+ if dynamic_build_dependencies:
+ qobj |= Q(dynamicbuilddep=dynamic_build_dependencies)
+ init_qs = init_qs.filter(qobj).distinct()
+
# support searches by layer name
elif item.startswith('layer:'):
query_layername = item.split(':')[1].strip().lower()
@@ -845,6 +858,8 @@ class RecipeDetailView(DetailView):
if append.matches_recipe(recipe):
verappends.append(append)
context['verappends'] = verappends
+ context['packageconfigs'] = recipe.packageconfig_set.order_by('feature')
+ context['staticdependencies'] = recipe.staticbuilddep_set.order_by('name')
return context