All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tinfoil.py: validate argument in parse_recipe_file
@ 2017-04-05 21:33 Juro Bystricky
  2017-04-06  1:32 ` Christopher Larson
  0 siblings, 1 reply; 4+ messages in thread
From: Juro Bystricky @ 2017-04-05 21:33 UTC (permalink / raw)
  To: bitbake-devel

Check for an empty file name to avoid an exception.

[YOCTO#11210]

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
---
 bitbake/lib/bb/tinfoil.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py
index 928333a..620f409 100644
--- a/bitbake/lib/bb/tinfoil.py
+++ b/bitbake/lib/bb/tinfoil.py
@@ -399,6 +399,8 @@ class Tinfoil:
                          specify config_data then you cannot use a virtual
                          specification for fn.
         """
+        if not fn:
+            return None
         if appends and appendlist == []:
             appends = False
         if config_data:
-- 
2.7.4



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

* Re: [PATCH] tinfoil.py: validate argument in parse_recipe_file
  2017-04-05 21:33 [PATCH] tinfoil.py: validate argument in parse_recipe_file Juro Bystricky
@ 2017-04-06  1:32 ` Christopher Larson
  2017-04-06 15:15   ` Bystricky, Juro
  0 siblings, 1 reply; 4+ messages in thread
From: Christopher Larson @ 2017-04-06  1:32 UTC (permalink / raw)
  To: Juro Bystricky; +Cc: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 551 bytes --]

On Wed, Apr 5, 2017 at 2:33 PM, Juro Bystricky <juro.bystricky@intel.com>
wrote:

> Check for an empty file name to avoid an exception.
>
> [YOCTO#11210]
>
> Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
>

IMO this is pointless. If you’re calling parse_recipe_file with an empty
string, it’s programmer error, which means raising an exception is a
completely reasonable thing to do.
-- 
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Senior Software Engineer, Mentor Graphics

[-- Attachment #2: Type: text/html, Size: 1118 bytes --]

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

* Re: [PATCH] tinfoil.py: validate argument in parse_recipe_file
  2017-04-06  1:32 ` Christopher Larson
@ 2017-04-06 15:15   ` Bystricky, Juro
  2017-04-06 20:40     ` Paul Eggleton
  0 siblings, 1 reply; 4+ messages in thread
From: Bystricky, Juro @ 2017-04-06 15:15 UTC (permalink / raw)
  To: Christopher Larson; +Cc: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 1125 bytes --]

parse_recipe can be called from parse_recipe_file as well. If parse_recipe_file is called with a non-existing recipe, you end up with the exception as well. IMHO for a  non-existent recipe parse_recipe should return None (instead of an exception)


________________________________
From: Christopher Larson [kergoth@gmail.com]
Sent: Wednesday, April 05, 2017 6:32 PM
To: Bystricky, Juro
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [bitbake-devel] [PATCH] tinfoil.py: validate argument in parse_recipe_file


On Wed, Apr 5, 2017 at 2:33 PM, Juro Bystricky <juro.bystricky@intel.com<mailto:juro.bystricky@intel.com>> wrote:
Check for an empty file name to avoid an exception.

[YOCTO#11210]

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com<mailto:juro.bystricky@intel.com>>

IMO this is pointless. If you’re calling parse_recipe_file with an empty string, it’s programmer error, which means raising an exception is a completely reasonable thing to do.
--
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Senior Software Engineer, Mentor Graphics

[-- Attachment #2: Type: text/html, Size: 2284 bytes --]

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

* Re: [PATCH] tinfoil.py: validate argument in parse_recipe_file
  2017-04-06 15:15   ` Bystricky, Juro
@ 2017-04-06 20:40     ` Paul Eggleton
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2017-04-06 20:40 UTC (permalink / raw)
  To: Bystricky, Juro; +Cc: bitbake-devel

On Friday, 7 April 2017 3:15:21 AM NZST Bystricky, Juro wrote:
> parse_recipe can be called from parse_recipe_file as well. If
> parse_recipe_file is called with a non-existing recipe, you end up with the
> exception as well. IMHO for a  non-existent recipe parse_recipe should
> return None (instead of an exception)

I'm not sure I agree - an exception under these circumstances seems completely 
reasonable to me as well.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

end of thread, other threads:[~2017-04-06 20:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-05 21:33 [PATCH] tinfoil.py: validate argument in parse_recipe_file Juro Bystricky
2017-04-06  1:32 ` Christopher Larson
2017-04-06 15:15   ` Bystricky, Juro
2017-04-06 20:40     ` Paul Eggleton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.