summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/__init__.py
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-08-30 10:49:10 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-31 11:37:10 +0100
commit71fdc64b8a975ca527cb7b2af6bc144f5c04ca7e (patch)
treef1baa21c0f0976d95880791a60341ea20089f5f4 /scripts/lib/devtool/__init__.py
parent906f885efe9f5fb1e69f71dd49ea65facd17deb3 (diff)
downloadpoky-71fdc64b8a975ca527cb7b2af6bc144f5c04ca7e.tar.gz
devtool: make 2 functions public
Moved standard.py:_parse_recipe -> __init__.py:parse_recipe and standard.py:_get_recipe_file -> __init__.py:get_recipe_file to be able to call them from other modules. (From OE-Core rev: f0e61a0d5597017c5f5d2dafb41118b79f505d9b) Signed-off-by: Ed Bartosh <ed.bartosh@linux.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__.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index 1747fff486..97ac6aeb80 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -116,3 +116,30 @@ def add_md5(config, recipename, filename):
116 md5 = bb.utils.md5_file(filename) 116 md5 = bb.utils.md5_file(filename)
117 with open(os.path.join(config.workspace_path, '.devtool_md5'), 'a') as f: 117 with open(os.path.join(config.workspace_path, '.devtool_md5'), 'a') as f:
118 f.write('%s|%s|%s\n' % (recipename, os.path.relpath(filename, config.workspace_path), md5)) 118 f.write('%s|%s|%s\n' % (recipename, os.path.relpath(filename, config.workspace_path), md5))
119
120def get_recipe_file(cooker, pn):
121 """Find recipe file corresponding a package name"""
122 import oe.recipeutils
123 recipefile = oe.recipeutils.pn_to_recipe(cooker, pn)
124 if not recipefile:
125 skipreasons = oe.recipeutils.get_unavailable_reasons(cooker, pn)
126 if skipreasons:
127 logger.error('\n'.join(skipreasons))
128 else:
129 logger.error("Unable to find any recipe file matching %s" % pn)
130 return recipefile
131
132def parse_recipe(config, tinfoil, pn, appends):
133 """Parse recipe of a package"""
134 import oe.recipeutils
135 recipefile = get_recipe_file(tinfoil.cooker, pn)
136 if not recipefile:
137 # Error already logged
138 return None
139 if appends:
140 append_files = tinfoil.cooker.collection.get_file_appends(recipefile)
141 # Filter out appends from the workspace
142 append_files = [path for path in append_files if
143 not path.startswith(config.workspace_path)]
144 return oe.recipeutils.parse_recipe(recipefile, append_files,
145 tinfoil.config_data)