]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: recipe path broken in recipe detail page
authorDavid Reyna <David.Reyna@windriver.com>
Mon, 30 Mar 2015 14:12:01 +0000 (07:12 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 17 Apr 2015 10:53:34 +0000 (11:53 +0100)
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>
lib/toaster/orm/models.py
lib/toaster/toastergui/templates/recipes.html

index 4a6ca8f2b19f8da732db51a3f0826c8b0620770c..b9bb896b57af6d399fee250a5366fb41ce7ba604 100644 (file)
@@ -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
 
index 889e676b4579abdba259403a90bbc014b02803d1..458d724568762fc35bd519716e835cf4cc4d8d61 100644 (file)
@@ -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 -->