[Toaster] [PATCH] toaster: orm better detect requires during CustomImageRecipe generation

Smith, Elliot elliot.smith at intel.com
Fri Apr 1 04:58:49 PDT 2016


Sent upstream to bitbake-devel and added to toaster-next.

Elliot

On 31 March 2016 at 14:48, Joshua Lock <joshua.g.lock at intel.com> wrote:

> 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.
>
> Signed-off-by: Joshua Lock <joshua.g.lock at intel.com>
> ---
>  bitbake/lib/toaster/orm/models.py | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/bitbake/lib/toaster/orm/models.py
> b/bitbake/lib/toaster/orm/models.py
> index 6ae6316..610d542 100644
> --- a/bitbake/lib/toaster/orm/models.py
> +++ b/bitbake/lib/toaster/orm/models.py
> @@ -1547,11 +1547,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(
> --
> 2.5.5
>
> --
> _______________________________________________
> toaster mailing list
> toaster at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
>



-- 
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/toaster/attachments/20160401/4ff548f0/attachment.html>


More information about the toaster mailing list