aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Reyna <David.Reyna@windriver.com>2015-03-30 07:12:01 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-04-17 11:53:34 +0100
commitee5c569ebe21c065508cd816ae8cb8842baf0b7e (patch)
tree749b6d2b974a565a8aeeb46ea3537e1f88916ddd
parentff475c1a6dec883f855dfce7cb0650135da33751 (diff)
downloadbitbake-ee5c569ebe21c065508cd816ae8cb8842baf0b7e.tar.gz
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] Signed-off-by: David Reyna <David.Reyna@windriver.com>
-rw-r--r--lib/toaster/orm/models.py8
-rw-r--r--lib/toaster/toastergui/templates/recipes.html2
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index 4a6ca8f2b..b9bb896b5 100644
--- a/lib/toaster/orm/models.py
+++ b/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/lib/toaster/toastergui/templates/recipes.html b/lib/toaster/toastergui/templates/recipes.html
index 889e676b4..458d72456 100644
--- a/lib/toaster/toastergui/templates/recipes.html
+++ b/lib/toaster/toastergui/templates/recipes.html
@@ -80,7 +80,7 @@
{% endwith %}
</td>
<!-- Recipe file -->
- <td class="recipe_file">{{recipe.file_path}}</td>
+ <td class="recipe_file">{{recipe.get_local_path}}</td>
<!-- Section -->
<td class="recipe_section">{{recipe.section}}</td>
<!-- License -->