Patchwork [1/1] sanity.bbclass: Detect empty $PATH components too

login
register
mail settings
Submitter Peter Seebach
Date May 9, 2012, 8:19 p.m.
Message ID <dc093825d1d099dcf0d221c651aba5bf54231623.1336594657.git.peter.seebach@windriver.com>
Download mbox | patch
Permalink /patch/27401/
State New
Headers show

Comments

Peter Seebach - May 9, 2012, 8:19 p.m.
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.

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
---
 meta/classes/sanity.bbclass |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 687ddeb..1384592 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -298,8 +298,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