[bitbake-devel,7/9] toaster/models.py: allow local paths for custom recipe's base

Submitted by Reyna, David on Sept. 6, 2018, 5:26 a.m. | Patch ID: 154587

Details

Message ID c8be3cac8fd74c32adc60d63002af556e87556c9.1536210899.git.David.Reyna@windriver.com
State New
Headers show

Commit Message

Reyna, David Sept. 6, 2018, 5:26 a.m.
From: Awais Belal <awais_belal@mentor.com>

In a case where the layer source is local only and the recipe
is not yet built, we can search for the path with layer's
local_source_dir, and if available that should be used rather
than just skipping the scenario.

[YOCTO #12891]

Signed-off-by: Awais Belal <awais_belal@mentor.com>
Signed-off-by: David Reyna <David.Reyna@windriver.com>
---
 lib/toaster/orm/models.py | 7 +++++++
 1 file changed, 7 insertions(+)

Patch hide | download patch | download mbox

diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index 3a7dff8..4b77e8f 100644
--- a/lib/toaster/orm/models.py
+++ b/lib/toaster/orm/models.py
@@ -1663,6 +1663,9 @@  class CustomImageRecipe(Recipe):
 
         path_schema_two = self.base_recipe.file_path
 
+        path_schema_three = "%s/%s" % (self.base_recipe.layer_version.layer.local_source_dir,
+                                     self.base_recipe.file_path)
+
         if os.path.exists(path_schema_one):
             return path_schema_one
 
@@ -1670,6 +1673,10 @@  class CustomImageRecipe(Recipe):
         if os.path.exists(path_schema_two):
             return path_schema_two
 
+        # Or a local path if all layers are local
+        if os.path.exists(path_schema_three):
+            return path_schema_three
+
         return None
 
     def generate_recipe_file_contents(self):