[bitbake-devel,2/2] tinfoil: improve get_recipe_file() exception text

Submitted by Paul Eggleton on March 30, 2017, 2:24 a.m. | Patch ID: 138598

Details

Message ID 478d4c6b740a26b8af498db5624440de00b691dd.1490840595.git.paul.eggleton@linux.intel.com
State New
Headers show

Commit Message

Paul Eggleton March 30, 2017, 2:24 a.m.
* Turn reasons from a list into a string (usually there will be only one
  reason, but the interface provides for more than one) and state up
  front that the recipe is unavailable for clarity
* Use quotes around invalid recipe name

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 lib/bb/tinfoil.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py
index 14a2271..928333a 100644
--- a/lib/bb/tinfoil.py
+++ b/lib/bb/tinfoil.py
@@ -368,9 +368,9 @@  class Tinfoil:
             taskdata = bb.taskdata.TaskData(None, skiplist=skiplist)
             skipreasons = taskdata.get_reasons(pn)
             if skipreasons:
-                raise bb.providers.NoProvider(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)
+                raise bb.providers.NoProvider('Unable to find any recipe file matching "%s"' % pn)
         return best[3]
 
     def get_file_appends(self, fn):