summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/standard.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/devtool/standard.py')
-rw-r--r--scripts/lib/devtool/standard.py36
1 files changed, 4 insertions, 32 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 4aa6ebd072..97c45d93b0 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -26,7 +26,7 @@ import argparse
26import scriptutils 26import scriptutils
27import errno 27import errno
28from devtool import exec_build_env_command, setup_tinfoil, DevtoolError 28from devtool import exec_build_env_command, setup_tinfoil, DevtoolError
29from devtool import add_md5 29from devtool import add_md5, parse_recipe
30 30
31logger = logging.getLogger('devtool') 31logger = logging.getLogger('devtool')
32 32
@@ -157,34 +157,6 @@ def _check_compatible_recipe(pn, d):
157 "from working. You will need to disable this " 157 "from working. You will need to disable this "
158 "first." % pn) 158 "first." % pn)
159 159
160def _get_recipe_file(cooker, pn):
161 """Find recipe file corresponding a package name"""
162 import oe.recipeutils
163 recipefile = oe.recipeutils.pn_to_recipe(cooker, pn)
164 if not recipefile:
165 skipreasons = oe.recipeutils.get_unavailable_reasons(cooker, pn)
166 if skipreasons:
167 logger.error('\n'.join(skipreasons))
168 else:
169 logger.error("Unable to find any recipe file matching %s" % pn)
170 return recipefile
171
172def _parse_recipe(config, tinfoil, pn, appends):
173 """Parse recipe of a package"""
174 import oe.recipeutils
175 recipefile = _get_recipe_file(tinfoil.cooker, pn)
176 if not recipefile:
177 # Error already logged
178 return None
179 if appends:
180 append_files = tinfoil.cooker.collection.get_file_appends(recipefile)
181 # Filter out appends from the workspace
182 append_files = [path for path in append_files if
183 not path.startswith(config.workspace_path)]
184 return oe.recipeutils.parse_recipe(recipefile, append_files,
185 tinfoil.config_data)
186
187
188def _ls_tree(directory): 160def _ls_tree(directory):
189 """Recursive listing of files in a directory""" 161 """Recursive listing of files in a directory"""
190 ret = [] 162 ret = []
@@ -200,7 +172,7 @@ def extract(args, config, basepath, workspace):
200 172
201 tinfoil = setup_tinfoil() 173 tinfoil = setup_tinfoil()
202 174
203 rd = _parse_recipe(config, tinfoil, args.recipename, True) 175 rd = parse_recipe(config, tinfoil, args.recipename, True)
204 if not rd: 176 if not rd:
205 return 1 177 return 1
206 178
@@ -420,7 +392,7 @@ def modify(args, config, basepath, workspace):
420 392
421 tinfoil = setup_tinfoil() 393 tinfoil = setup_tinfoil()
422 394
423 rd = _parse_recipe(config, tinfoil, args.recipename, True) 395 rd = parse_recipe(config, tinfoil, args.recipename, True)
424 if not rd: 396 if not rd:
425 return 1 397 return 1
426 recipefile = rd.getVar('FILE', True) 398 recipefile = rd.getVar('FILE', True)
@@ -762,7 +734,7 @@ def update_recipe(args, config, basepath, workspace):
762 734
763 tinfoil = setup_tinfoil() 735 tinfoil = setup_tinfoil()
764 736
765 rd = _parse_recipe(config, tinfoil, args.recipename, True) 737 rd = parse_recipe(config, tinfoil, args.recipename, True)
766 if not rd: 738 if not rd:
767 return 1 739 return 1
768 740