From 532f42985f9dfb600b6a501436bddff746388640 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Thu, 7 Jan 2016 00:15:53 +1300 Subject: devtool: refactor code for getting local recipe file We're doing this in a couple of places, let's just find the recipe file if it exists within the workspace (which it will if it's been added through "devtool add") when we read in the workspace. (From OE-Core rev: 81cf5580993c99050e3f4d6d891bc67534721487) Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- scripts/devtool | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'scripts/devtool') diff --git a/scripts/devtool b/scripts/devtool index bda05e1c2f..2d57da0bc1 100755 --- a/scripts/devtool +++ b/scripts/devtool @@ -112,8 +112,18 @@ def read_workspace(): res = externalsrc_re.match(line.rstrip()) if res: pn = res.group(2) or os.path.splitext(os.path.basename(fn))[0].split('_')[0] + # Find the recipe file within the workspace, if any + bbfile = os.path.basename(fn).replace('.bbappend', '.bb').replace('%', '*') + recipefile = glob.glob(os.path.join(config.workspace_path, + 'recipes', + pn, + bbfile)) + if recipefile: + recipefile = recipefile[0] workspace[pn] = {'srctree': res.group(3), - 'bbappend': fn} + 'bbappend': fn, + 'recipefile': recipefile} + logger.debug('Found recipe %s' % workspace[pn]) def create_workspace(args, config, basepath, workspace): if args.layerpath: -- cgit v1.2.3-54-g00ecf