aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py7
-rw-r--r--bitbake/lib/toaster/bldcontrol/localhostbecontroller.py25
-rw-r--r--bitbake/lib/toaster/orm/models.py3
-rw-r--r--bitbake/lib/toaster/toastergui/api.py4
4 files changed, 23 insertions, 16 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 5b69660a393..6d87a4e2907 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -42,7 +42,7 @@ from orm.models import Variable, VariableHistory
from orm.models import Package, Package_File, Target_Installed_Package, Target_File
from orm.models import Task_Dependency, Package_Dependency
from orm.models import Recipe_Dependency, Provides
-from orm.models import Project, CustomImagePackage, CustomImageRecipe
+from orm.models import Project, CustomImagePackage
from orm.models import signal_runbuilds
from bldcontrol.models import BuildEnvironment, BuildRequest
@@ -361,11 +361,6 @@ class ORMWrapper(object):
def get_update_layer_version_object(self, build_obj, layer_obj, layer_version_information):
if isinstance(layer_obj, Layer_Version):
- # Special case the toaster-custom-images layer which is created
- # on the fly so don't update the values which may cause the layer
- # to be duplicated on a future get_or_create
- if layer_obj.layer.name == CustomImageRecipe.LAYER_NAME:
- return layer_obj
# We already found our layer version for this build so just
# update it with the new build information
logger.debug("We found our layer from toaster")
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index a64e89b93b8..83bd6209095 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -228,13 +228,22 @@ class LocalhostBEController(BuildEnvironmentController):
br_layer_base_recipe = layers.get(
layer_version=customrecipe.base_recipe.layer_version)
- br_layer_base_dirpath = \
- os.path.join(self.be.sourcedir,
- self.getGitCloneDirectory(
- br_layer_base_recipe.giturl,
- br_layer_base_recipe.commit),
- customrecipe.base_recipe.layer_version.dirpath
- )
+ # If the layer is one that we've cloned we know where it lives
+ if br_layer_base_recipe.giturl and br_layer_base_recipe.commit:
+ layer_path = self.getGitCloneDirectory(
+ br_layer_base_recipe.giturl,
+ br_layer_base_recipe.commit)
+ # Otherwise it's a local layer
+ elif br_layer_base_recipe.local_source_dir:
+ layer_path = br_layer_base_recipe.local_source_dir
+ else:
+ logger.error("Unable to workout the dir path for the custom"
+ " image recipe")
+
+ br_layer_base_dirpath = os.path.join(
+ self.be.sourcedir,
+ layer_path,
+ customrecipe.base_recipe.layer_version.dirpath)
customrecipe.base_recipe.layer_version.dirpath = \
br_layer_base_dirpath
@@ -249,6 +258,8 @@ class LocalhostBEController(BuildEnvironmentController):
# Update the layer and recipe objects
customrecipe.layer_version.dirpath = layerpath
+ customrecipe.layer_version.layer.local_source_dir = layerpath
+ customrecipe.layer_version.layer.save()
customrecipe.layer_version.save()
customrecipe.file_path = recipe_path
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index a7de57c2561..2c1edc94708 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -1631,7 +1631,8 @@ class CustomImageRecipe(Recipe):
if base_recipe_path:
base_recipe = open(base_recipe_path, 'r').read()
else:
- raise IOError("Based on recipe file not found")
+ raise IOError("Based on recipe file not found: %s" %
+ base_recipe_path)
# Add a special case for when the recipe we have based a custom image
# recipe on requires another recipe.
diff --git a/bitbake/lib/toaster/toastergui/api.py b/bitbake/lib/toaster/toastergui/api.py
index ae1f1507705..e4c3b84d637 100644
--- a/bitbake/lib/toaster/toastergui/api.py
+++ b/bitbake/lib/toaster/toastergui/api.py
@@ -293,8 +293,7 @@ class XhrCustomRecipe(View):
# create layer 'Custom layer' and verion if needed
layer = Layer.objects.get_or_create(
name=CustomImageRecipe.LAYER_NAME,
- summary="Layer for custom recipes",
- vcs_url="file:///toaster_created_layer")[0]
+ summary="Layer for custom recipes")[0]
# Check if we have a layer version already
# We don't use get_or_create here because the dirpath will change
@@ -306,6 +305,7 @@ class XhrCustomRecipe(View):
lver, created = Layer_Version.objects.get_or_create(
project=params['project'],
layer=layer,
+ layer_source=LayerSource.TYPE_LOCAL,
dirpath="toaster_created_layer")
# Add a dependency on our layer to the base recipe's layer