sanity.bbclass: Detect empty $PATH components too
authorPeter Seebach <peter.seebach@windriver.com>
Wed, 9 May 2012 20:14:41 +0000 (15:14 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 11 May 2012 16:50:49 +0000 (17:50 +0100)
Empty components in $PATH have the same effect as a . in $PATH,
and are a common side-effect of inserting a misspelled or unset
shell variable in $PATH.

(From OE-Core rev: ac4201b714c83c614113bfa735d0a2fc6f64db99)

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/sanity.bbclass

index 635049e..05545f4 100644 (file)
@@ -368,8 +368,9 @@ def check_sanity(e):
         if not check_app_exists("qemu-arm", e.data):
             messages = messages + "qemu-native was in ASSUME_PROVIDED but the QEMU binaries (qemu-arm) can't be found in PATH"
 
-    if "." in data.getVar('PATH', e.data, True).split(":"):
-        messages = messages + "PATH contains '.' which will break the build, please remove this"
+    paths = data.getVar('PATH', e.data, True).split(":")
+    if "." in paths or "" in paths:
+        messages = messages + "PATH contains '.' or '', which will break the build, please remove this."
 
     if data.getVar('TARGET_ARCH', e.data, True) == "arm":
         # This path is no longer user-readable in modern (very recent) Linux