@@ -685,7 +685,14 @@ class Tinfoil:
if skipreasons:
raise bb.providers.NoProvider('%s is unavailable:\n %s' % (pn, ' \n'.join(skipreasons)))
else:
- raise bb.providers.NoProvider('Unable to find any recipe file matching "%s"' % pn)
+ msg = f'Unable to find any recipe file matching "{pn}"'
+ import difflib
+ providers = self.get_all_providers()
+ close_matches = difflib.get_close_matches(pn, providers, cutoff=0.7)
+ if close_matches:
+ close_matches = "\n ".join(close_matches)
+ msg += f'. Close matches:\n {close_matches}'
+ raise bb.providers.NoProvider(msg)
return best[3]
def get_file_appends(self, fn, mc=''):
When calling 'bitbake-getvar -r somerecipe FOO', show close matches when 'somerecipe' doesn't exist but close matches are found. This replicates the behavior of 'bitbake -e'. Example output: $ bitbake-getvar -r binutils-cross FOO Unable to find any recipe file matching "binutils-cross". Close matches: binutils-cross-aarch64 binutils util-macros Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> --- lib/bb/tinfoil.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- base-commit: d9700632bd6b627d1124fdc83ddf7bfb4199228d change-id: 20260220-bitbake-getvar-close-matches-cdc2b547546e