summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-01-27 12:44:54 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-10 13:29:20 +0000
commit38f49132706d260498ed221c51d3aeef36dde0e9 (patch)
treec10335cf25e992ec75e19cf5dc47af3b1e1c4c07 /bitbake/lib
parent769017e477caeb87db719d6b2760af36c930e45f (diff)
downloadpoky-38f49132706d260498ed221c51d3aeef36dde0e9.tar.gz
bitbake: toaster: orm generate_recipe_file_contents Handler for require recipe
Add a special case for when the recipe we have based a custom image recipe on requires another recipe. In this case we need to adjust the file location to be able to require the recipe when we're in the toaster-custom-images layer. For example: "require core-image-minimal.bb" is changed to: "require recipes-core/images/core-image-minimal.bb" (Bitbake rev: 26025e1ea49b3ebfcfd508d1608fa8c9e722ad03) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/toaster/orm/models.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 4e790c2dd6..ba1eb0f2c8 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -1426,7 +1426,6 @@ class CustomImageRecipe(Recipe):
1426 Q(pk__in=self.excludes_set.values_list('pk', flat=True)) | 1426 Q(pk__in=self.excludes_set.values_list('pk', flat=True)) |
1427 Q(name__icontains="packagegroup") | 1427 Q(name__icontains="packagegroup") |
1428 Q(name__icontains="locale")): 1428 Q(name__icontains="locale")):
1429 print pkg.name
1430 packages_conf += pkg.name+' ' 1429 packages_conf += pkg.name+' '
1431 1430
1432 packages_conf += "\"" 1431 packages_conf += "\""
@@ -1435,6 +1434,29 @@ class CustomImageRecipe(Recipe):
1435 (self.base_recipe.layer_version.dirpath, 1434 (self.base_recipe.layer_version.dirpath,
1436 self.base_recipe.file_path), 'r').read() 1435 self.base_recipe.file_path), 'r').read()
1437 1436
1437 # Add a special case for when the recipe we have based a custom image
1438 # recipe on requires another recipe.
1439 # For example:
1440 # "require core-image-minimal.bb" is changed to:
1441 # "require recipes-core/images/core-image-minimal.bb"
1442
1443 if "require" in base_recipe:
1444 req_search = re.search(r'(require\s+)(.+\.bb\s*$)',
1445 base_recipe,
1446 re.MULTILINE)
1447
1448 require_filename = req_search.group(2).strip()
1449
1450 corrected_location = Recipe.objects.filter(
1451 Q(layer_version=self.base_recipe.layer_version) &
1452 Q(file_path__icontains=require_filename)).last().file_path
1453
1454 new_require_line = "require %s" % corrected_location
1455
1456 base_recipe = \
1457 base_recipe.replace(req_search.group(0), new_require_line)
1458
1459
1438 info = {"date" : timezone.now().strftime("%Y-%m-%d %H:%M:%S"), 1460 info = {"date" : timezone.now().strftime("%Y-%m-%d %H:%M:%S"),
1439 "base_recipe" : base_recipe, 1461 "base_recipe" : base_recipe,
1440 "recipe_name" : self.name, 1462 "recipe_name" : self.name,