From 25ebd3bbc1f9f4b1b6147d98dd43690c3bf03ee7 Mon Sep 17 00:00:00 2001 From: Jeremy Puhlman Date: Mon, 1 Aug 2016 09:02:54 -0700 Subject: Fix random python backtrace in mutlilib handling code. newval is not defined in all cases. Set to None and check if it is set. File "/local/foo/builds/x86/layers/openembedded-core/meta/classes/multilib_global.bbclass", line 90, in preferred_ml_updates(d=): if not d.getVar(newname, False): > d.setVar(newname, localdata.expand(newval)) # Avoid future variable key expansion UnboundLocalError: local variable 'newval' referenced before assignment Signed-off-by: Jeremy Puhlman Signed-off-by: Ross Burton --- meta/classes/multilib_global.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'meta') diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass index 67dc72b76c..11ae2681f0 100644 --- a/meta/classes/multilib_global.bbclass +++ b/meta/classes/multilib_global.bbclass @@ -72,6 +72,7 @@ def preferred_ml_updates(d): pkg = pkg.replace("virtual/", "") virt = "virtual/" for p in prefixes: + newval = None if pkg != "kernel": newval = p + "-" + val @@ -86,7 +87,7 @@ def preferred_ml_updates(d): # implement alternative multilib name newname = localdata.expand("PREFERRED_PROVIDER_" + virt + p + "-" + pkg) - if not d.getVar(newname, False): + if not d.getVar(newname, False) and newval != None: d.setVar(newname, localdata.expand(newval)) # Avoid future variable key expansion provexp = d.expand(prov) -- cgit v1.2.3