diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-01-07 00:15:54 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-11 15:41:07 +0000 |
commit | e1bf6a30679a83d4dbcf37276204f639541e95f9 (patch) | |
tree | aae23da8aeb7f184029af08750cb2010893bf72e /scripts/lib/devtool/__init__.py | |
parent | 81cf5580993c99050e3f4d6d891bc67534721487 (diff) | |
download | openembedded-core-contrib-e1bf6a30679a83d4dbcf37276204f639541e95f9.tar.gz |
devtool: reset: support recipes with BBCLASSEXTEND
If the recipe file itself was created in the workspace, and it uses
BBCLASSEXTEND (e.g. through devtool add --also-native), then we need to
clean the other variants as well.
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 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index 7f16e17935..253e4d5e35 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py @@ -214,3 +214,27 @@ def recipe_to_append(recipefile, config, wildcard=False): appendpath = os.path.join(config.workspace_path, 'appends') appendfile = os.path.join(appendpath, appendname + '.bbappend') return appendfile + +def get_bbclassextend_targets(recipefile, pn): + """ + Cheap function to get BBCLASSEXTEND and then convert that to the + list of targets that would result. + """ + import bb.utils + + values = {} + def get_bbclassextend_varfunc(varname, origvalue, op, newlines): + values[varname] = origvalue + return origvalue, None, 0, True + with open(recipefile, 'r') as f: + bb.utils.edit_metadata(f, ['BBCLASSEXTEND'], get_bbclassextend_varfunc) + + targets = [] + bbclassextend = values.get('BBCLASSEXTEND', '').split() + if bbclassextend: + for variant in bbclassextend: + if variant == 'nativesdk': + targets.append('%s-%s' % (variant, pn)) + elif variant in ['native', 'cross', 'crosssdk']: + targets.append('%s-%s' % (pn, variant)) + return targets |