diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-12-22 17:03:06 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-28 09:25:13 +0000 |
commit | 20746544231f9e239ae5ca8993c0369578af9214 (patch) | |
tree | a5321ebbb3c071870b4a6ab5e31ece2c1bb1f93a /scripts/lib/devtool/__init__.py | |
parent | 6acbdc9cf190c4dd464791885666e0ba1459b8dd (diff) | |
download | poky-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/__init__.py')
-rw-r--r-- | scripts/lib/devtool/__init__.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index e617d60405..7f16e17935 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py | |||
@@ -22,6 +22,7 @@ import os | |||
22 | import sys | 22 | import sys |
23 | import subprocess | 23 | import subprocess |
24 | import logging | 24 | import logging |
25 | import re | ||
25 | 26 | ||
26 | logger = logging.getLogger('devtool') | 27 | logger = logging.getLogger('devtool') |
27 | 28 | ||
@@ -199,3 +200,17 @@ def setup_git_repo(repodir, version, devbranch, basetag='devtool-base'): | |||
199 | 200 | ||
200 | bb.process.run('git checkout -b %s' % devbranch, cwd=repodir) | 201 | bb.process.run('git checkout -b %s' % devbranch, cwd=repodir) |
201 | bb.process.run('git tag -f %s' % basetag, cwd=repodir) | 202 | bb.process.run('git tag -f %s' % basetag, cwd=repodir) |
203 | |||
204 | def recipe_to_append(recipefile, config, wildcard=False): | ||
205 | """ | ||
206 | Convert a recipe file to a bbappend file path within the workspace. | ||
207 | NOTE: if the bbappend already exists, you should be using | ||
208 | workspace[args.recipename]['bbappend'] instead of calling this | ||
209 | function. | ||
210 | """ | ||
211 | appendname = os.path.splitext(os.path.basename(recipefile))[0] | ||
212 | if wildcard: | ||
213 | appendname = re.sub(r'_.*', '_%', appendname) | ||
214 | appendpath = os.path.join(config.workspace_path, 'appends') | ||
215 | appendfile = os.path.join(appendpath, appendname + '.bbappend') | ||
216 | return appendfile | ||