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.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 658076c048..e85e1ad860 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -430,6 +430,16 @@ def modify(args, config, basepath, workspace):
430 if not rd: 430 if not rd:
431 return 1 431 return 1
432 recipefile = rd.getVar('FILE', True) 432 recipefile = rd.getVar('FILE', True)
433 appendname = os.path.splitext(os.path.basename(recipefile))[0]
434 if args.wildcard:
435 appendname = re.sub(r'_.*', '_%', appendname)
436 appendpath = os.path.join(config.workspace_path, 'appends')
437 appendfile = os.path.join(appendpath, appendname + '.bbappend')
438 if os.path.exists(appendfile):
439 raise DevtoolError("Another variant of recipe %s is already in your "
440 "workspace (only one variant of a recipe can "
441 "currently be worked on at once)"
442 % args.recipename)
433 443
434 _check_compatible_recipe(args.recipename, rd) 444 _check_compatible_recipe(args.recipename, rd)
435 445
@@ -467,14 +477,8 @@ def modify(args, config, basepath, workspace):
467 srcsubdir = os.path.relpath(s, workdir).split(os.sep, 1)[1] 477 srcsubdir = os.path.relpath(s, workdir).split(os.sep, 1)[1]
468 srctree = os.path.join(srctree, srcsubdir) 478 srctree = os.path.join(srctree, srcsubdir)
469 479
470 appendpath = os.path.join(config.workspace_path, 'appends')
471 if not os.path.exists(appendpath): 480 if not os.path.exists(appendpath):
472 os.makedirs(appendpath) 481 os.makedirs(appendpath)
473
474 appendname = os.path.splitext(os.path.basename(recipefile))[0]
475 if args.wildcard:
476 appendname = re.sub(r'_.*', '_%', appendname)
477 appendfile = os.path.join(appendpath, appendname + '.bbappend')
478 with open(appendfile, 'w') as f: 482 with open(appendfile, 'w') as f:
479 f.write('FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n\n') 483 f.write('FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n\n')
480 f.write('inherit externalsrc\n') 484 f.write('inherit externalsrc\n')
@@ -777,7 +781,7 @@ def update_recipe(args, config, basepath, workspace):
777 else: 781 else:
778 mode = args.mode 782 mode = args.mode
779 783
780 srctree = workspace[args.recipename] 784 srctree = workspace[args.recipename]['srctree']
781 785
782 if mode == 'srcrev': 786 if mode == 'srcrev':
783 _update_recipe_srcrev(args, srctree, rd, tinfoil.config_data) 787 _update_recipe_srcrev(args, srctree, rd, tinfoil.config_data)
@@ -793,7 +797,7 @@ def status(args, config, basepath, workspace):
793 """Entry point for the devtool 'status' subcommand""" 797 """Entry point for the devtool 'status' subcommand"""
794 if workspace: 798 if workspace:
795 for recipe, value in workspace.iteritems(): 799 for recipe, value in workspace.iteritems():
796 print("%s: %s" % (recipe, value)) 800 print("%s: %s" % (recipe, value['srctree']))
797 else: 801 else:
798 logger.info('No recipes currently in your workspace - you can use "devtool modify" to work on an existing recipe or "devtool add" to add a new one') 802 logger.info('No recipes currently in your workspace - you can use "devtool modify" to work on an existing recipe or "devtool add" to add a new one')
799 return 0 803 return 0