[Toaster] [PATCH v2 5/5] toaster: orm generate CustomImageRecipe contents try secondary path
Michael Wood
michael.g.wood at intel.com
Mon Mar 7 08:03:19 PST 2016
Try a secondary file path if the first does not exist. When we get the
recipe paths and layer information from the layer index it is not a
complete path but we are usually able to reconstruct it. If the complete
real path has been discovered by building then use this instead.
[YOCTO #9206]
Signed-off-by: Michael Wood <michael.g.wood at intel.com>
---
bitbake/lib/toaster/orm/models.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index d451989..b89bfa9 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -1515,10 +1515,13 @@ class CustomImageRecipe(Recipe):
packages_conf += pkg.name+' '
packages_conf += "\""
-
- base_recipe = open("%s/%s" %
- (self.base_recipe.layer_version.dirpath,
- self.base_recipe.file_path), 'r').read()
+ try:
+ base_recipe = open("%s/%s" %
+ (self.base_recipe.layer_version.dirpath,
+ self.base_recipe.file_path), 'r').read()
+ except IOError:
+ # The path may now be the full path if the recipe has been built
+ base_recipe = open(self.base_recipe.file_path, 'r').read()
# Add a special case for when the recipe we have based a custom image
# recipe on requires another recipe.
--
2.5.0
More information about the toaster
mailing list