diff options
Diffstat (limited to 'scripts/lib/devtool/__init__.py')
| -rw-r--r-- | scripts/lib/devtool/__init__.py | 26 |
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 | ||
| 123 | def 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 | |||
| 135 | def parse_recipe(config, tinfoil, pn, appends, filter_workspace=True): | 123 | def 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 | ||
| 152 | def check_workspace_recipe(workspace, pn, checksrc=True, bbclassextend=False): | 140 | def check_workspace_recipe(workspace, pn, checksrc=True, bbclassextend=False): |
| 153 | """ | 141 | """ |
