diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-05-14 11:47:35 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-05-16 22:31:51 +0100 |
commit | 293c82baa454c5cb4d2ed00c2764e2c279cee6aa (patch) | |
tree | f1a674c853c6d9b8e34cd925f456c413c7bb7414 /scripts/lib/devtool/deploy.py | |
parent | 5796fe4591e69bad8616eb9d7628dd3eb148033e (diff) | |
download | poky-293c82baa454c5cb4d2ed00c2764e2c279cee6aa.tar.gz |
devtool: deploy-target: use tinfoil instead of bitbake -e
Using tinfoil here is quicker and tidier than shelling out to
bitbake -e and interpreting its output.
(From OE-Core rev: 986ad99aee98dd5b7f30d59098dd9275097b8276)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/deploy.py')
-rw-r--r-- | scripts/lib/devtool/deploy.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/lib/devtool/deploy.py b/scripts/lib/devtool/deploy.py index 078c74b45d..92a3cb4cff 100644 --- a/scripts/lib/devtool/deploy.py +++ b/scripts/lib/devtool/deploy.py | |||
@@ -19,7 +19,7 @@ | |||
19 | import os | 19 | import os |
20 | import subprocess | 20 | import subprocess |
21 | import logging | 21 | import logging |
22 | from devtool import exec_build_env_command | 22 | from devtool import exec_build_env_command, setup_tinfoil |
23 | 23 | ||
24 | logger = logging.getLogger('devtool') | 24 | logger = logging.getLogger('devtool') |
25 | 25 | ||
@@ -31,6 +31,7 @@ def plugin_init(pluginlist): | |||
31 | def deploy(args, config, basepath, workspace): | 31 | def deploy(args, config, basepath, workspace): |
32 | """Entry point for the devtool 'deploy' subcommand""" | 32 | """Entry point for the devtool 'deploy' subcommand""" |
33 | import re | 33 | import re |
34 | import oe.recipeutils | ||
34 | 35 | ||
35 | if not args.recipename in workspace: | 36 | if not args.recipename in workspace: |
36 | logger.error("no recipe named %s in your workspace" % args.recipename) | 37 | logger.error("no recipe named %s in your workspace" % args.recipename) |
@@ -45,8 +46,13 @@ def deploy(args, config, basepath, workspace): | |||
45 | deploy_dir = os.path.join(basepath, 'target_deploy', args.target) | 46 | deploy_dir = os.path.join(basepath, 'target_deploy', args.target) |
46 | deploy_file = os.path.join(deploy_dir, args.recipename + '.list') | 47 | deploy_file = os.path.join(deploy_dir, args.recipename + '.list') |
47 | 48 | ||
48 | stdout, _ = exec_build_env_command(config.init_path, basepath, 'bitbake -e %s' % args.recipename, shell=True) | 49 | tinfoil = setup_tinfoil() |
49 | recipe_outdir = re.search(r'^D="(.*)"', stdout, re.MULTILINE).group(1) | 50 | try: |
51 | rd = oe.recipeutils.parse_recipe_simple(tinfoil.cooker, args.recipename, tinfoil.config_data) | ||
52 | except Exception as e: | ||
53 | logger.error('Exception parsing recipe %s: %s' % (args.recipename, e)) | ||
54 | return 2 | ||
55 | recipe_outdir = rd.getVar('D', True) | ||
50 | if not os.path.exists(recipe_outdir) or not os.listdir(recipe_outdir): | 56 | if not os.path.exists(recipe_outdir) or not os.listdir(recipe_outdir): |
51 | logger.error('No files to deploy - have you built the %s recipe? If so, the install step has not installed any files.' % args.recipename) | 57 | logger.error('No files to deploy - have you built the %s recipe? If so, the install step has not installed any files.' % args.recipename) |
52 | return -1 | 58 | return -1 |