summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/standard.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/devtool/standard.py')
-rw-r--r--scripts/lib/devtool/standard.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 4dc175d117..d9b5d15279 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -64,8 +64,12 @@ def add(args, config, basepath, workspace):
64 color = 'always' 64 color = 'always'
65 else: 65 else:
66 color = args.color 66 color = args.color
67 stdout, stderr = exec_build_env_command(config.init_path, basepath, 'recipetool --color=%s create -o %s %s' % (color, recipefile, srctree)) 67 try:
68 logger.info('Recipe %s has been automatically created; further editing may be required to make it fully functional' % recipefile) 68 stdout, stderr = exec_build_env_command(config.init_path, basepath, 'recipetool --color=%s create -o %s "%s"' % (color, recipefile, srctree))
69 logger.info('Recipe %s has been automatically created; further editing may be required to make it fully functional' % recipefile)
70 except bb.process.ExecutionError as e:
71 logger.error('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
72 return 1
69 73
70 _add_md5(config, args.recipename, recipefile) 74 _add_md5(config, args.recipename, recipefile)
71 75
@@ -610,7 +614,7 @@ def status(args, config, basepath, workspace):
610 614
611 615
612def reset(args, config, basepath, workspace): 616def reset(args, config, basepath, workspace):
613 import bb.utils 617 import bb
614 if args.recipename: 618 if args.recipename:
615 if args.all: 619 if args.all:
616 logger.error("Recipe cannot be specified if -a/--all is used") 620 logger.error("Recipe cannot be specified if -a/--all is used")
@@ -630,7 +634,11 @@ def reset(args, config, basepath, workspace):
630 for pn in recipes: 634 for pn in recipes:
631 if not args.no_clean: 635 if not args.no_clean:
632 logger.info('Cleaning sysroot for recipe %s...' % pn) 636 logger.info('Cleaning sysroot for recipe %s...' % pn)
633 exec_build_env_command(config.init_path, basepath, 'bitbake -c clean %s' % pn) 637 try:
638 exec_build_env_command(config.init_path, basepath, 'bitbake -c clean %s' % pn)
639 except bb.process.ExecutionError as e:
640 logger.error('Command \'%s\' failed, output:\n%s\nIf you wish, you may specify -n/--no-clean to skip running this command when resetting' % (e.command, e.stdout))
641 return 1
634 642
635 _check_preserve(config, pn) 643 _check_preserve(config, pn)
636 644
@@ -656,7 +664,11 @@ def build(args, config, basepath, workspace):
656 logger.error("no recipe named %s in your workspace" % args.recipename) 664 logger.error("no recipe named %s in your workspace" % args.recipename)
657 return -1 665 return -1
658 build_task = config.get('Build', 'build_task', 'populate_sysroot') 666 build_task = config.get('Build', 'build_task', 'populate_sysroot')
659 exec_build_env_command(config.init_path, basepath, 'bitbake -c %s %s' % (build_task, args.recipename), watch=True) 667 try:
668 exec_build_env_command(config.init_path, basepath, 'bitbake -c %s %s' % (build_task, args.recipename), watch=True)
669 except bb.process.ExecutionError as e:
670 # We've already seen the output since watch=True, so just ensure we return something to the user
671 return e.exitcode
660 672
661 return 0 673 return 0
662 674