summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-03-21 18:14:00 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-25 10:29:13 +0000
commit06845723d4f4461dc5730da814c4e193b27b5d03 (patch)
tree2d06a7b5e7edd2548959f16431fa653c8b8324e9 /scripts/lib
parent50addfb97bb901dce5551c124e7ba27f920b02ef (diff)
downloadpoky-06845723d4f4461dc5730da814c4e193b27b5d03.tar.gz
devtool: sdk-install: add option to allow building from source
By default the sdk-install subcommand expects to restore the requested items from sstate and fails if it can't. If the user is OK with building from source, add a -s/--allow-build option to allow them to do that. In the process, ensure we show the status output while we're installing. Also add the missing header to the top of the file. (From OE-Core rev: a86b426cdd465ec5cb08bb5fa7729e4e673d94bb) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/devtool/sdk.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/scripts/lib/devtool/sdk.py b/scripts/lib/devtool/sdk.py
index 22c52799e2..b1905f9863 100644
--- a/scripts/lib/devtool/sdk.py
+++ b/scripts/lib/devtool/sdk.py
@@ -1,4 +1,19 @@
1# Development tool - sdk-update command plugin 1# Development tool - sdk-update command plugin
2#
3# Copyright (C) 2015-2016 Intel Corporation
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License version 2 as
7# published by the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with this program; if not, write to the Free Software Foundation, Inc.,
16# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2 17
3import os 18import os
4import subprocess 19import subprocess
@@ -278,8 +293,11 @@ def sdk_install(args, config, basepath, workspace):
278 if recipe.endswith('-native') and 'package' in task: 293 if recipe.endswith('-native') and 'package' in task:
279 continue 294 continue
280 install_tasks.append('%s:%s' % (recipe, task)) 295 install_tasks.append('%s:%s' % (recipe, task))
296 options = ''
297 if not args.allow_build:
298 options += ' --setscene-only'
281 try: 299 try:
282 exec_build_env_command(config.init_path, basepath, 'bitbake --setscene-only %s' % ' '.join(install_tasks)) 300 exec_build_env_command(config.init_path, basepath, 'bitbake %s %s' % (options, ' '.join(install_tasks)), watch=True)
283 except bb.process.ExecutionError as e: 301 except bb.process.ExecutionError as e:
284 raise DevtoolError('Failed to install %s:\n%s' % (recipe, str(e))) 302 raise DevtoolError('Failed to install %s:\n%s' % (recipe, str(e)))
285 failed = False 303 failed = False
@@ -312,4 +330,5 @@ def register_commands(subparsers, context):
312 description='Installs additional recipe development files into the SDK. (You can use "devtool search" to find available recipes.)', 330 description='Installs additional recipe development files into the SDK. (You can use "devtool search" to find available recipes.)',
313 group='sdk') 331 group='sdk')
314 parser_sdk_install.add_argument('recipename', help='Name of the recipe to install the development artifacts for', nargs='+') 332 parser_sdk_install.add_argument('recipename', help='Name of the recipe to install the development artifacts for', nargs='+')
333 parser_sdk_install.add_argument('-s', '--allow-build', help='Allow building requested item(s) from source', action='store_true')
315 parser_sdk_install.set_defaults(func=sdk_install) 334 parser_sdk_install.set_defaults(func=sdk_install)