]> code.ossystems Code Review - openembedded-core.git/commitdiff
linuxloader: Avoid confusing string concat errors
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 19 Dec 2020 11:42:58 +0000 (11:42 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 27 Jan 2021 09:32:57 +0000 (09:32 +0000)
None is a bad choice of return value for functions used in variables
(strings) as a failure results in concatination errors. Use a string
with a clear meaning that can be searched for instead.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/linuxloader.bbclass

index ec0e0556dd859defe221b8db1001d762933418cc..796ab3afe4a288916085d459f495386014182fa0 100644 (file)
@@ -1,6 +1,6 @@
 def get_musl_loader_arch(d):
     import re
-    ldso_arch = None
+    ldso_arch = "NotSupported"
 
     targetarch = d.getVar("TARGET_ARCH")
     if targetarch.startswith("microblaze"):
@@ -30,7 +30,7 @@ def get_musl_loader(d):
 def get_glibc_loader(d):
     import re
 
-    dynamic_loader = None
+    dynamic_loader = "NotSupported"
     targetarch = d.getVar("TARGET_ARCH")
     if targetarch in ["powerpc", "microblaze"]:
         dynamic_loader = "${base_libdir}/ld.so.1"
@@ -56,7 +56,7 @@ def get_linuxloader(d):
     overrides = d.getVar("OVERRIDES").split(":")
 
     if "libc-baremetal" in overrides:
-        return None
+        return "NotSupported"
 
     if "libc-musl" in overrides:
         dynamic_loader = get_musl_loader(d)