Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [PATCH 0/2] tinfoil: fixes for get_recipe_file()
@ 2017-03-30  2:23 Paul Eggleton
  2017-03-30  2:23 ` [PATCH 1/2] tinfoil: fix get_recipe_file() to return an error on invalid recipe Paul Eggleton
  2017-03-30  2:24 ` [PATCH 2/2] tinfoil: improve get_recipe_file() exception text Paul Eggleton
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Eggleton @ 2017-03-30  2:23 UTC (permalink / raw)
  To: bitbake-devel

The following changes since commit 968a77388dd1a24c1dadec6ce49bf53ebb5b643f:

  lib/bb/codeparser: ensure BufferedLogger respects target logging level (2017-03-28 23:07:15 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib paule/tinfoil-noprovider
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/tinfoil-noprovider

Paul Eggleton (2):
  tinfoil: fix get_recipe_file() to return an error on invalid recipe
  tinfoil: improve get_recipe_file() exception text

 lib/bb/tinfoil.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.9.3



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] tinfoil: fix get_recipe_file() to return an error on invalid recipe
  2017-03-30  2:23 [PATCH 0/2] tinfoil: fixes for get_recipe_file() Paul Eggleton
@ 2017-03-30  2:23 ` Paul Eggleton
  2017-03-30  2:24 ` [PATCH 2/2] tinfoil: improve get_recipe_file() exception text Paul Eggleton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2017-03-30  2:23 UTC (permalink / raw)
  To: bitbake-devel

This function calls cooker.findBestProvider() but didn't handle the fact
that that function returns a tuple (None, None, None, None) when there
is no matching recipe. (This fixes devtool in OpenEmbedded showing a
traceback when an invalid recipe is specified instead of a proper error
message.)

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

diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py
index c2ee707..14a2271 100644
--- a/lib/bb/tinfoil.py
+++ b/lib/bb/tinfoil.py
@@ -363,7 +363,7 @@ class Tinfoil:
         skipped.
         """
         best = self.find_best_provider(pn)
-        if not best:
+        if not best or (len(best) > 3 and not best[3]):
             skiplist = self.get_skipped_recipes()
             taskdata = bb.taskdata.TaskData(None, skiplist=skiplist)
             skipreasons = taskdata.get_reasons(pn)
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] tinfoil: improve get_recipe_file() exception text
  2017-03-30  2:23 [PATCH 0/2] tinfoil: fixes for get_recipe_file() Paul Eggleton
  2017-03-30  2:23 ` [PATCH 1/2] tinfoil: fix get_recipe_file() to return an error on invalid recipe Paul Eggleton
@ 2017-03-30  2:24 ` Paul Eggleton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2017-03-30  2:24 UTC (permalink / raw)
  To: bitbake-devel

* 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(-)

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):
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-30  2:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-30  2:23 [PATCH 0/2] tinfoil: fixes for get_recipe_file() Paul Eggleton
2017-03-30  2:23 ` [PATCH 1/2] tinfoil: fix get_recipe_file() to return an error on invalid recipe Paul Eggleton
2017-03-30  2:24 ` [PATCH 2/2] tinfoil: improve get_recipe_file() exception text Paul Eggleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox