Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mail.openembedded.org (Postfix) with ESMTP id 82F7D735FA for ; Tue, 21 Apr 2015 14:50:44 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 21 Apr 2015 07:50:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,616,1422950400"; d="scan'208";a="716925396" Received: from marquiz.fi.intel.com ([10.237.72.155]) by orsmga002.jf.intel.com with ESMTP; 21 Apr 2015 07:50:44 -0700 From: Markus Lehtonen To: openembedded-core@lists.openembedded.org Date: Tue, 21 Apr 2015 17:50:43 +0300 Message-Id: <1429627843-28955-1-git-send-email-markus.lehtonen@linux.intel.com> X-Mailer: git-send-email 2.1.4 Cc: Paul Eggleton Subject: [PATCH] devtool: include bbappends in recipe parsing X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2015 14:50:48 -0000 In order to get correct metadata, SRCREV for example. Signed-off-by: Markus Lehtonen --- meta/lib/oe/recipeutils.py | 6 +++--- scripts/lib/devtool/standard.py | 32 +++++++++++++++++++------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index 159a103..09bd7fd 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py @@ -44,10 +44,10 @@ def get_unavailable_reasons(cooker, pn): return taskdata.get_reasons(pn) -def parse_recipe(fn, d): +def parse_recipe(fn, appends, d): """Parse an individual recipe""" import bb.cache - envdata = bb.cache.Cache.loadDataFull(fn, [], d) + envdata = bb.cache.Cache.loadDataFull(fn, appends, d) return envdata @@ -55,7 +55,7 @@ def get_var_files(fn, varlist, d): """Find the file in which each of a list of variables is set. Note: requires variable history to be enabled when parsing. """ - envdata = parse_recipe(fn, d) + envdata = parse_recipe(fn, [], d) varfiles = {} for v in varlist: history = envdata.varhistory.variable(v) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index d5ded2f..96e3bdb 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -130,18 +130,26 @@ def _get_recipe_file(cooker, pn): logger.error("Unable to find any recipe file matching %s" % pn) return recipefile +def _parse_recipe(tinfoil, pn, appends): + """Parse recipe of a package""" + import oe.recipeutils + recipefile = _get_recipe_file(tinfoil.cooker, pn) + if not recipefile: + # Error already logged + return None + if appends: + append_files = tinfoil.cooker.collection.get_file_appends(recipefile) + return oe.recipeutils.parse_recipe(recipefile, append_files, + tinfoil.config_data) def extract(args, config, basepath, workspace): import bb - import oe.recipeutils tinfoil = setup_tinfoil() - recipefile = _get_recipe_file(tinfoil.cooker, args.recipename) - if not recipefile: - # Error already logged + rd = _parse_recipe(tinfoil, args.recipename, True) + if not rd: return -1 - rd = oe.recipeutils.parse_recipe(recipefile, tinfoil.config_data) srctree = os.path.abspath(args.srctree) initial_rev = _extract_source(srctree, args.keep_temp, args.branch, rd) @@ -327,11 +335,10 @@ def modify(args, config, basepath, workspace): tinfoil = setup_tinfoil() - recipefile = _get_recipe_file(tinfoil.cooker, args.recipename) - if not recipefile: - # Error already logged + rd = _parse_recipe(tinfoil, args.recipename, True) + if not rd: return -1 - rd = oe.recipeutils.parse_recipe(recipefile, tinfoil.config_data) + recipefile = rd.getVar('FILE', True) if not _check_compatible_recipe(args.recipename, rd): return -1 @@ -418,11 +425,10 @@ def update_recipe(args, config, basepath, workspace): from oe.patch import GitApplyTree import oe.recipeutils - recipefile = _get_recipe_file(tinfoil.cooker, args.recipename) - if not recipefile: - # Error already logged + rd = _parse_recipe(tinfoil, args.recipename, True) + if not rd: return -1 - rd = oe.recipeutils.parse_recipe(recipefile, tinfoil.config_data) + recipefile = rd.getVar('FILE', True) orig_src_uri = rd.getVar('SRC_URI', False) or '' if args.mode == 'auto': -- 2.1.4