summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-05-14 11:44:59 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-16 22:31:51 +0100
commit5796fe4591e69bad8616eb9d7628dd3eb148033e (patch)
treec2e23d3b047965fe466b2eb3babd8ff92412c5d1 /meta
parent1bab18f26fe162cc2f577944f02ec3a2d4f01702 (diff)
downloadpoky-5796fe4591e69bad8616eb9d7628dd3eb148033e.tar.gz
lib/oe/recipeutils: add a parse_recipe_simple() function
Add a function that simply parses a recipe by name and optionally the bbappends that apply to it. (Note that if you're using tinfoil you need to have initialised it with config_only=False so that it can map the recipe name to a recipe file.) (From OE-Core rev: a8f221f6c6c0562a5ed06438231c2906e542fb7b) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/recipeutils.py29
1 files changed, 26 insertions, 3 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 19d97b62d2..0689fb0c71 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -44,13 +44,36 @@ def get_unavailable_reasons(cooker, pn):
44 return taskdata.get_reasons(pn) 44 return taskdata.get_reasons(pn)
45 45
46 46
47def parse_recipe(fn, appends, d): 47def parse_recipe(fn, appendfiles, d):
48 """Parse an individual recipe""" 48 """
49 Parse an individual recipe file, optionally with a list of
50 bbappend files.
51 """
49 import bb.cache 52 import bb.cache
50 envdata = bb.cache.Cache.loadDataFull(fn, appends, d) 53 envdata = bb.cache.Cache.loadDataFull(fn, appendfiles, d)
51 return envdata 54 return envdata
52 55
53 56
57def parse_recipe_simple(cooker, pn, d, appends=True):
58 """
59 Parse a recipe and optionally all bbappends that apply to it
60 in the current configuration.
61 """
62 import bb.providers
63
64 recipefile = pn_to_recipe(cooker, pn)
65 if not recipefile:
66 skipreasons = get_unavailable_reasons(cooker, pn)
67 # We may as well re-use bb.providers.NoProvider here
68 if skipreasons:
69 raise bb.providers.NoProvider(skipreasons)
70 else:
71 raise bb.providers.NoProvider('Unable to find any recipe file matching %s' % pn)
72 if appends:
73 appendfiles = cooker.collection.get_file_appends(recipefile)
74 return parse_recipe(recipefile, appendfiles, d)
75
76
54def get_var_files(fn, varlist, d): 77def get_var_files(fn, varlist, d):
55 """Find the file in which each of a list of variables is set. 78 """Find the file in which each of a list of variables is set.
56 Note: requires variable history to be enabled when parsing. 79 Note: requires variable history to be enabled when parsing.