summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/devtool/__init__.py')
-rw-r--r--scripts/lib/devtool/__init__.py24
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):
214 appendpath = os.path.join(config.workspace_path, 'appends') 214 appendpath = os.path.join(config.workspace_path, 'appends')
215 appendfile = os.path.join(appendpath, appendname + '.bbappend') 215 appendfile = os.path.join(appendpath, appendname + '.bbappend')
216 return appendfile 216 return appendfile
217
218def get_bbclassextend_targets(recipefile, pn):
219 """
220 Cheap function to get BBCLASSEXTEND and then convert that to the
221 list of targets that would result.
222 """
223 import bb.utils
224
225 values = {}
226 def get_bbclassextend_varfunc(varname, origvalue, op, newlines):
227 values[varname] = origvalue
228 return origvalue, None, 0, True
229 with open(recipefile, 'r') as f:
230 bb.utils.edit_metadata(f, ['BBCLASSEXTEND'], get_bbclassextend_varfunc)
231
232 targets = []
233 bbclassextend = values.get('BBCLASSEXTEND', '').split()
234 if bbclassextend:
235 for variant in bbclassextend:
236 if variant == 'nativesdk':
237 targets.append('%s-%s' % (variant, pn))
238 elif variant in ['native', 'cross', 'crosssdk']:
239 targets.append('%s-%s' % (pn, variant))
240 return targets