]> code.ossystems Code Review - openembedded-core.git/commitdiff
sanity.bbclass: improve the sanity check for PATH and BBPATH
authorShiqun Lin <Shiqun.Lin@windriver.com>
Wed, 7 Jan 2015 07:00:31 +0000 (15:00 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 20 May 2015 20:40:14 +0000 (21:40 +0100)
Build fails if "./" is in the PATH

To reproduce the issue:

  $ export PATH="./:$PATH"
  $ make -C build-tools elfutils

  Error: ./ld: unrecognized option '--sysroot=/'

Signed-off-by: Shiqun Lin <Shiqun.Lin@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/sanity.bbclass

index fc8c98051568603ef1462e38ca817229ca833763..e7381107adb10cbeeb477493256d0893ba9605d9 100644 (file)
@@ -653,9 +653,9 @@ def check_sanity_version_change(status, d):
             status.addresult("You have a 32-bit libc, but no 32-bit headers.  You must install the 32-bit libc headers.\n")
 
     bbpaths = d.getVar('BBPATH', True).split(":")
-    if ("." in bbpaths or "" in bbpaths) and not status.reparse:
+    if ("." in bbpaths or "./" in bbpaths or "" in bbpaths) and not status.reparse:
         status.addresult("BBPATH references the current directory, either through "    \
-                "an empty entry, or a '.'.\n\t This is unsafe and means your "\
+                "an empty entry, a './' or a '.'.\n\t This is unsafe and means your "\
                 "layer configuration is adding empty elements to BBPATH.\n\t "\
                 "Please check your layer.conf files and other BBPATH "        \
                 "settings to remove the current working directory "           \
@@ -693,8 +693,8 @@ def check_sanity_everybuild(status, d):
     sanity_check_conffiles(status, d)
 
     paths = d.getVar('PATH', True).split(":")
-    if "." in paths or "" in paths:
-        status.addresult("PATH contains '.' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n")
+    if "." in paths or "./" in paths or "" in paths:
+        status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n")
 
     # Check that the DISTRO is valid, if set
     # need to take into account DISTRO renaming DISTRO