From db254cb513b1ad5f67f42321e01a42ec47572243 Mon Sep 17 00:00:00 2001 From: David Reyna Date: Mon, 30 Mar 2015 07:12:01 -0700 Subject: bitbake: toaster: recipe path broken in recipe detail page The recipe paths in managed mode are not processed correctly. They need any prefix tags removed, and then any build path prefix removed only if present. [YOCTO #7523] (Bitbake rev: ee5c569ebe21c065508cd816ae8cb8842baf0b7e) Signed-off-by: David Reyna Signed-off-by: Richard Purdie --- bitbake/lib/toaster/orm/models.py | 8 +++++++- bitbake/lib/toaster/toastergui/templates/recipes.html | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 4a6ca8f2b1..b9bb896b57 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -557,7 +557,13 @@ class Recipe(models.Model): def get_local_path(self): if settings.MANAGED and self.layer_version.build.project is not None: - return self.file_path[len(self.layer_version.layer.local_path)+1:] + # strip any tag prefixes ('virtual:native:') + layer_path=self.layer_version.layer.local_path.split(":")[-1] + recipe_path=self.file_path.split(":")[-1] + if 0 == recipe_path.find(layer_path): + return recipe_path[len(layer_path)+1:] + else: + return recipe_path return self.file_path diff --git a/bitbake/lib/toaster/toastergui/templates/recipes.html b/bitbake/lib/toaster/toastergui/templates/recipes.html index 889e676b45..458d724568 100644 --- a/bitbake/lib/toaster/toastergui/templates/recipes.html +++ b/bitbake/lib/toaster/toastergui/templates/recipes.html @@ -80,7 +80,7 @@ {% endwith %} - {{recipe.file_path}} + {{recipe.get_local_path}} {{recipe.section}} -- cgit v1.2.3-54-g00ecf