bitbake: toaster: orm better detect requires during CustomImageRecipe generation

We were doing a string search for the literal string "require" and
assuming that a match meant the recipe uses the require keyword to
include the contents of another recipe. This test isn't very smart (it
should at least have matched on "require ") and triggers on the word
require anywhere in the recipe, i.e. the word "required" in the
DESCRIPTION of core-image-lsb.bb, and then breaks as the much smarter
regex fails to match anything.

Instead always run the regex search and only try to update the
require entry when the regex matches.

(Bitbake rev: a6add0e95d3d1e9a6a9fcabd73543bc5c278915f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Joshua Lock 2016-04-01 12:57:58 +01:00 committed by Richard Purdie
parent c634473ed3
commit 158575c738
1 changed files with 2 additions and 3 deletions

View File

@ -1548,11 +1548,10 @@ class CustomImageRecipe(Recipe):
# "require core-image-minimal.bb" is changed to:
# "require recipes-core/images/core-image-minimal.bb"
if "require" in base_recipe:
req_search = re.search(r'(require\s+)(.+\.bb\s*$)',
req_search = re.search(r'(require\s+)(.+\.bb\s*$)',
base_recipe,
re.MULTILINE)
if req_search:
require_filename = req_search.group(2).strip()
corrected_location = Recipe.objects.filter(