summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/standard.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-12-22 17:03:06 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-28 09:25:13 +0000
commit20746544231f9e239ae5ca8993c0369578af9214 (patch)
treea5321ebbb3c071870b4a6ab5e31ece2c1bb1f93a /scripts/lib/devtool/standard.py
parent6acbdc9cf190c4dd464791885666e0ba1459b8dd (diff)
downloadpoky-20746544231f9e239ae5ca8993c0369578af9214.tar.gz
devtool: split out function for naming bbappend
We're repeating this in a couple of places, so we might as well have a function to do it. (From OE-Core rev: 67a28109a1ee1383d1b17a8dafa4fe510948238b) 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/standard.py')
-rw-r--r--scripts/lib/devtool/standard.py18
1 files changed, 5 insertions, 13 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 57175a449a..0103d936b5 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -26,7 +26,7 @@ import argparse
26import scriptutils 26import scriptutils
27import errno 27import errno
28from collections import OrderedDict 28from collections import OrderedDict
29from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, use_external_build, setup_git_repo, DevtoolError 29from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, use_external_build, setup_git_repo, recipe_to_append, DevtoolError
30from devtool import parse_recipe 30from devtool import parse_recipe
31 31
32logger = logging.getLogger('devtool') 32logger = logging.getLogger('devtool')
@@ -64,10 +64,6 @@ def add(args, config, basepath, workspace):
64 raise DevtoolError("Specified source tree %s could not be found" % 64 raise DevtoolError("Specified source tree %s could not be found" %
65 srctree) 65 srctree)
66 66
67 appendpath = os.path.join(config.workspace_path, 'appends')
68 if not os.path.exists(appendpath):
69 os.makedirs(appendpath)
70
71 recipedir = os.path.join(config.workspace_path, 'recipes', args.recipename) 67 recipedir = os.path.join(config.workspace_path, 'recipes', args.recipename)
72 bb.utils.mkdirhier(recipedir) 68 bb.utils.mkdirhier(recipedir)
73 rfv = None 69 rfv = None
@@ -121,7 +117,8 @@ def add(args, config, basepath, workspace):
121 if not rd: 117 if not rd:
122 return 1 118 return 1
123 119
124 appendfile = os.path.join(appendpath, '%s.bbappend' % bp) 120 appendfile = recipe_to_append(recipefile, config)
121 bb.utils.mkdirhier(os.path.dirname(appendfile))
125 with open(appendfile, 'w') as f: 122 with open(appendfile, 'w') as f:
126 f.write('inherit externalsrc\n') 123 f.write('inherit externalsrc\n')
127 f.write('EXTERNALSRC = "%s"\n' % srctree) 124 f.write('EXTERNALSRC = "%s"\n' % srctree)
@@ -584,11 +581,7 @@ def modify(args, config, basepath, workspace):
584 pn) 581 pn)
585 582
586 recipefile = rd.getVar('FILE', True) 583 recipefile = rd.getVar('FILE', True)
587 appendname = os.path.splitext(os.path.basename(recipefile))[0] 584 appendfile = recipe_to_append(recipefile, config, args.wildcard)
588 if args.wildcard:
589 appendname = re.sub(r'_.*', '_%', appendname)
590 appendpath = os.path.join(config.workspace_path, 'appends')
591 appendfile = os.path.join(appendpath, appendname + '.bbappend')
592 if os.path.exists(appendfile): 585 if os.path.exists(appendfile):
593 raise DevtoolError("Another variant of recipe %s is already in your " 586 raise DevtoolError("Another variant of recipe %s is already in your "
594 "workspace (only one variant of a recipe can " 587 "workspace (only one variant of a recipe can "
@@ -632,8 +625,7 @@ def modify(args, config, basepath, workspace):
632 srcsubdir = os.path.relpath(s, workdir).split(os.sep, 1)[1] 625 srcsubdir = os.path.relpath(s, workdir).split(os.sep, 1)[1]
633 srctree = os.path.join(srctree, srcsubdir) 626 srctree = os.path.join(srctree, srcsubdir)
634 627
635 if not os.path.exists(appendpath): 628 bb.utils.mkdirhier(os.path.dirname(appendfile))
636 os.makedirs(appendpath)
637 with open(appendfile, 'w') as f: 629 with open(appendfile, 'w') as f:
638 f.write('FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n') 630 f.write('FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n')
639 # Local files can be modified/tracked in separate subdir under srctree 631 # Local files can be modified/tracked in separate subdir under srctree