[oe-commits] [openembedded-core] 17/44: Fix random python backtrace in mutlilib handling code.

git at git.openembedded.org git at git.openembedded.org
Wed Aug 3 12:01:18 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit edf5619b46f8fa1f414335c0d7cf8eaab6b16211
Author: Jeremy Puhlman <jpuhlman at mvista.com>
AuthorDate: Mon Aug 1 09:02:54 2016 -0700

    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=<bb.data_smart.DataSmart object at
    0xf6fd528c>):
                     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 <jpuhlman at mvista.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/multilib_global.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass
index 67dc72b..11ae268 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)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list