aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2018-03-21 16:52:49 +1300
committerPaul Eggleton <paul.eggleton@linux.intel.com>2018-05-04 23:57:53 +1200
commitea6270f3863d4318add1c8d6b9cd8ca28a61231b (patch)
tree43a7b5f217246baddee1480b25ef301f4b207e1b
parentb2a67d718cbbe004a940145fc12ccfac56490765 (diff)
downloadopenembedded-core-contrib-ea6270f3863d4318add1c8d6b9cd8ca28a61231b.tar.gz
rrs: handle dependency field differences
The old RRS branch had its own addition of dependency support, but in the mean time we added that to the layer index in the master branch using a different structure. Adapt the RRS recipe detail page to that structure. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-rw-r--r--layerindex/models.py3
-rw-r--r--rrs/views.py6
-rw-r--r--templates/rrs/recipedetail.html7
3 files changed, 11 insertions, 5 deletions
diff --git a/layerindex/models.py b/layerindex/models.py
index 648ef1f9e8..2b9601a299 100644
--- a/layerindex/models.py
+++ b/layerindex/models.py
@@ -388,6 +388,9 @@ class PackageConfig(models.Model):
def __str__(self):
return "%s - %s" % (self.recipe, self.feature)
+ def get_deps_list(self):
+ return self.build_deps.split()
+
class StaticBuildDep(models.Model):
recipes = models.ManyToManyField(Recipe)
name = models.CharField(max_length=255)
diff --git a/rrs/views.py b/rrs/views.py
index 348b2d0629..24e1d0ec12 100644
--- a/rrs/views.py
+++ b/rrs/views.py
@@ -10,7 +10,7 @@ from django.views.generic import ListView, DetailView, RedirectView
from django.core.urlresolvers import resolve, reverse, reverse_lazy
from django.db import connection
-from layerindex.models import Recipe
+from layerindex.models import Recipe, StaticBuildDep
from rrs.models import Release, Milestone, Maintainer, RecipeMaintainerHistory, \
RecipeMaintainer, RecipeUpstreamHistory, RecipeUpstream, \
RecipeDistro, RecipeUpgrade, MaintenancePlan
@@ -711,9 +711,7 @@ class RecipeDetailView(DetailView):
for p in recipe.provides.split():
context['recipe_provides'].append(p)
- context['recipe_depends'] = []
- for d in recipe.depends.split():
- context['recipe_depends'].append(d)
+ context['recipe_depends'] = StaticBuildDep.objects.filter(recipes__id=recipe.id).values_list('name', flat=True)
context['recipe_distros'] = RecipeDistro.get_distros_by_recipe(recipe)
diff --git a/templates/rrs/recipedetail.html b/templates/rrs/recipedetail.html
index 4f67700ec0..c0c812fa1e 100644
--- a/templates/rrs/recipedetail.html
+++ b/templates/rrs/recipedetail.html
@@ -156,13 +156,18 @@
</dd>
{% endif %}
- {% if recipe_depends %}
+ {% if recipe_depends or recipe.packageconfig_set %}
<dt>Depends</dt>
<dd>
<ul class="unstyled">
{% for d in recipe_depends %}
<li>{{ d }}</li>
{% endfor %}
+ {% for pkc in recipe.packageconfig_set.all %}
+ {% for dep in pkc.get_deps_list %}
+ <li>{{ dep }} (optional)</li>
+ {% endfor %}
+ {% endfor %}
</ul>
</dd>
{% endif %}