summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/__init__.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-12-13 20:09:36 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-14 12:30:49 +0000
commit70ce5952373cedc1620a9c2d1e1348ab972124cb (patch)
treea2a5aaf4c01f7ef569829de29be8faa45c28cffd /scripts/lib/devtool/__init__.py
parent1f8cf63f8affcf6c881c7842ef38b82b8781d2eb (diff)
downloadpoky-70ce5952373cedc1620a9c2d1e1348ab972124cb.tar.gz
devtool / recipetool: use tinfoil parsing API
Use Tinfoil.parse_recipe_file() and Tinfoil.parse_recipe() instead of the recipeutils equivalents, and replace any local duplicate implementations. This not only tidies up the code but also allows these calls to work in memres mode. (From OE-Core rev: f13b56266ee96dfab65a3a7db50e8051aa9f071a) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@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__.py26
1 files changed, 7 insertions, 19 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index 31ecb65937..99c5534893 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -120,34 +120,22 @@ def setup_tinfoil(config_only=False, basepath=None, tracking=False):
120 os.chdir(orig_cwd) 120 os.chdir(orig_cwd)
121 return tinfoil 121 return tinfoil
122 122
123def get_recipe_file(cooker, pn):
124 """Find recipe file corresponding a package name"""
125 import oe.recipeutils
126 recipefile = oe.recipeutils.pn_to_recipe(cooker, pn)
127 if not recipefile:
128 skipreasons = oe.recipeutils.get_unavailable_reasons(cooker, pn)
129 if skipreasons:
130 logger.error('\n'.join(skipreasons))
131 else:
132 logger.error("Unable to find any recipe file matching %s" % pn)
133 return recipefile
134
135def parse_recipe(config, tinfoil, pn, appends, filter_workspace=True): 123def parse_recipe(config, tinfoil, pn, appends, filter_workspace=True):
136 """Parse recipe of a package""" 124 """Parse the specified recipe"""
137 import oe.recipeutils 125 try:
138 recipefile = get_recipe_file(tinfoil.cooker, pn) 126 recipefile = tinfoil.get_recipe_file(pn)
139 if not recipefile: 127 except bb.providers.NoProvider as e:
140 # Error already logged 128 logger.error(str(e))
141 return None 129 return None
142 if appends: 130 if appends:
143 append_files = tinfoil.cooker.collection.get_file_appends(recipefile) 131 append_files = tinfoil.get_file_appends(recipefile)
144 if filter_workspace: 132 if filter_workspace:
145 # Filter out appends from the workspace 133 # Filter out appends from the workspace
146 append_files = [path for path in append_files if 134 append_files = [path for path in append_files if
147 not path.startswith(config.workspace_path)] 135 not path.startswith(config.workspace_path)]
148 else: 136 else:
149 append_files = None 137 append_files = None
150 return oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, append_files) 138 return tinfoil.parse_recipe_file(recipefile, appends, append_files)
151 139
152def check_workspace_recipe(workspace, pn, checksrc=True, bbclassextend=False): 140def check_workspace_recipe(workspace, pn, checksrc=True, bbclassextend=False):
153 """ 141 """