Patchwork [1/1] base.bbclass: Work even when there's no PNBLACKLIST entries

login
register
mail settings
Submitter Peter Seebach
Date Aug. 16, 2012, 4:50 p.m.
Message ID <71f45133289f617d85d0c9072ea3b4d584f5de67.1345135594.git.peter.seebach@windriver.com>
Download mbox | patch
Permalink /patch/34723/
State Accepted
Commit 491df239170dd20f3e91df6bc1ead2945a78e075
Headers show

Comments

Peter Seebach - Aug. 16, 2012, 4:50 p.m.
It turns out that the result of getVarFlags is not a list, it's
a dict. So "getVarFlags(...) or []" does not reliably produce
something with a .items. This escaped detection because our
local build environment never ends up running builds without
PNBLACKLIST entries.

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
---
 meta/classes/base.bbclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Richard Purdie - Aug. 17, 2012, 9:54 a.m.
On Thu, 2012-08-16 at 11:50 -0500, Peter Seebach wrote:
> It turns out that the result of getVarFlags is not a list, it's
> a dict. So "getVarFlags(...) or []" does not reliably produce
> something with a .items. This escaped detection because our
> local build environment never ends up running builds without
> PNBLACKLIST entries.
> 
> Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
> ---
>  meta/classes/base.bbclass |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index 840ddbc..acc3217 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -175,7 +175,7 @@ def preferred_ml_updates(d):
>  
>      versions = []
>      providers = []
> -    blacklists = d.getVarFlags('PNBLACKLIST') or []
> +    blacklists = d.getVarFlags('PNBLACKLIST') or {}
>      for v in d.keys():
>          if v.startswith("PREFERRED_VERSION_"):
>              versions.append(v)

Merged to master, thanks.

Richard

Patch

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 840ddbc..acc3217 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -175,7 +175,7 @@  def preferred_ml_updates(d):
 
     versions = []
     providers = []
-    blacklists = d.getVarFlags('PNBLACKLIST') or []
+    blacklists = d.getVarFlags('PNBLACKLIST') or {}
     for v in d.keys():
         if v.startswith("PREFERRED_VERSION_"):
             versions.append(v)