[oe-commits] [bitbake] 03/03: toaster: orm better detect requires during CustomImageRecipe generation

git at git.openembedded.org git at git.openembedded.org
Fri Apr 1 13:50:44 UTC 2016


rpurdie pushed a commit to branch master-next
in repository bitbake.

commit a6add0e95d3d1e9a6a9fcabd73543bc5c278915f
Author: Joshua Lock <joshua.g.lock at intel.com>
AuthorDate: Fri Apr 1 12:57:58 2016 +0100

    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.
    
    Signed-off-by: Joshua Lock <joshua.g.lock at intel.com>
    Signed-off-by: Elliot Smith <elliot.smith at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/toaster/orm/models.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index 08b1a7c..d3277ef 100644
--- a/lib/toaster/orm/models.py
+++ b/lib/toaster/orm/models.py
@@ -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(

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list