bitbake: event: Remove duplicated items from close matches

It printed duplicated ones when there are multiple similar recipes in
differrent layers, for example, if python-lockfile in different layers,
and there is no python3-lockfile:

$ bitbake python3-lockfile
ERROR: Nothing PROVIDES 'python3-lockfile'. Close matches:
python-lockfile
python-lockfile
python3-aiofiles

Remove the duplicated ones to fix the problem.

(Bitbake rev: 5612192cec9f467e2ab5a86482cb34876d198bc6)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Robert Yang
2020-02-18 18:48:02 +08:00
committed by Richard Purdie
parent 17c60cc27b
commit 50524c152c

View File

@@ -508,7 +508,7 @@ class NoProvider(Event):
extra = ''
if not self._reasons:
if self._close_matches:
extra = ". Close matches:\n %s" % '\n '.join(self._close_matches)
extra = ". Close matches:\n %s" % '\n '.join(sorted(set(self._close_matches)))
if self._dependees:
msg = "Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)%s" % (r, self._item, ", ".join(self._dependees), r, extra)