diff options
author | Jeremy Puhlman <jpuhlman@mvista.com> | 2016-08-01 09:02:54 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-04 15:22:22 +0100 |
commit | 8b5f369726de3ac354a68a48080eb532b5ec2b53 (patch) | |
tree | 5d1506d9b8b114f5ff610838a47ac61bb8528471 /meta/classes/multilib_global.bbclass | |
parent | 44ae8284d03c79deadd89ee5ee7ca75481ab9e53 (diff) | |
download | poky-8b5f369726de3ac354a68a48080eb532b5ec2b53.tar.gz |
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
(From OE-Core rev: 25ebd3bbc1f9f4b1b6147d98dd43690c3bf03ee7)
Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/multilib_global.bbclass')
-rw-r--r-- | meta/classes/multilib_global.bbclass | 3 |
1 files changed, 2 insertions, 1 deletions
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): | |||
72 | pkg = pkg.replace("virtual/", "") | 72 | pkg = pkg.replace("virtual/", "") |
73 | virt = "virtual/" | 73 | virt = "virtual/" |
74 | for p in prefixes: | 74 | for p in prefixes: |
75 | newval = None | ||
75 | if pkg != "kernel": | 76 | if pkg != "kernel": |
76 | newval = p + "-" + val | 77 | newval = p + "-" + val |
77 | 78 | ||
@@ -86,7 +87,7 @@ def preferred_ml_updates(d): | |||
86 | 87 | ||
87 | # implement alternative multilib name | 88 | # implement alternative multilib name |
88 | newname = localdata.expand("PREFERRED_PROVIDER_" + virt + p + "-" + pkg) | 89 | newname = localdata.expand("PREFERRED_PROVIDER_" + virt + p + "-" + pkg) |
89 | if not d.getVar(newname, False): | 90 | if not d.getVar(newname, False) and newval != None: |
90 | d.setVar(newname, localdata.expand(newval)) | 91 | d.setVar(newname, localdata.expand(newval)) |
91 | # Avoid future variable key expansion | 92 | # Avoid future variable key expansion |
92 | provexp = d.expand(prov) | 93 | provexp = d.expand(prov) |