From 38ed03975347424558fc02d2973eb4adc88ced85 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Thu, 7 Jan 2016 00:15:54 +1300 Subject: 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. (From OE-Core rev: e1bf6a30679a83d4dbcf37276204f639541e95f9) Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- scripts/lib/devtool/__init__.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'scripts/lib/devtool/__init__.py') 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 -- cgit v1.2.3-54-g00ecf