Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id D5139E00AAB; Thu, 31 Mar 2016 06:48:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [134.134.136.20 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 9168CE009C3 for ; Thu, 31 Mar 2016 06:48:56 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 31 Mar 2016 06:48:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,422,1455004800"; d="scan'208";a="922609012" Received: from jlock-mobl1.gar.corp.intel.com (HELO jlock-mobl.gar.corp.intel.com) ([10.252.26.209]) by orsmga001.jf.intel.com with ESMTP; 31 Mar 2016 06:48:54 -0700 From: Joshua Lock To: toaster@yoctoproject.org Date: Thu, 31 Mar 2016 14:48:46 +0100 Message-Id: <1459432126-16539-1-git-send-email-joshua.g.lock@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [PATCH] toaster: orm better detect requires during CustomImageRecipe generation X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 13:48:59 -0000 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 --- 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