diff options
Diffstat (limited to 'scripts/lib/devtool/__init__.py')
| -rw-r--r-- | scripts/lib/devtool/__init__.py | 27 |
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 | |||
| 120 | def 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 | |||
| 132 | def 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) | ||
