mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
bitbake: taskdata: report close matches with NoProvider errors
Assuming there is no known reason why an item is not provided, show close matches on the assumption that it might have been a typo or other mistake. (Bitbake rev: ed81b0856b4a3892b53d39871eaaa6273390ea75) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
baaa7adc16
commit
840a427ed2
@@ -390,6 +390,17 @@ class TaskData:
|
||||
reasons.append("%s PROVIDES %s but was skipped: %s" % (skipitem.pn, item, skipitem.skipreason))
|
||||
return reasons
|
||||
|
||||
def get_close_matches(self, item, provider_list):
|
||||
import difflib
|
||||
if self.skiplist:
|
||||
skipped = []
|
||||
for fn in self.skiplist:
|
||||
skipped.append(self.skiplist[fn].pn)
|
||||
full_list = provider_list + skipped
|
||||
else:
|
||||
full_list = provider_list
|
||||
return difflib.get_close_matches(item, full_list, cutoff=0.7)
|
||||
|
||||
def add_provider(self, cfgData, dataCache, item):
|
||||
try:
|
||||
self.add_provider_internal(cfgData, dataCache, item)
|
||||
@@ -411,7 +422,7 @@ class TaskData:
|
||||
return
|
||||
|
||||
if not item in dataCache.providers:
|
||||
bb.event.fire(bb.event.NoProvider(item, dependees=self.get_dependees_str(item), reasons=self.get_reasons(item)), cfgData)
|
||||
bb.event.fire(bb.event.NoProvider(item, dependees=self.get_dependees_str(item), reasons=self.get_reasons(item), close_matches=self.get_close_matches(item, dataCache.providers.keys())), cfgData)
|
||||
raise bb.providers.NoProvider(item)
|
||||
|
||||
if self.have_build_target(item):
|
||||
|
||||
Reference in New Issue
Block a user