summaryrefslogtreecommitdiffstats
path: root/meta/classes/sanity.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-04-19 12:11:31 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-04-20 13:56:48 +0100
commitad2206b3fafd32e87085eee4e614a678605fccf5 (patch)
tree7c498ac0d271df76dad8baee8b7b51fffc576b43 /meta/classes/sanity.bbclass
parent1e6a42e923f85fd359f9493ef737c873abf26867 (diff)
downloadpoky-ad2206b3fafd32e87085eee4e614a678605fccf5.tar.gz
sanity: Further improve directory sanity tests
Add tests to ensure COREBASE/TMPDIR doon't contain ".." as this causes hard to understand build failures. Also rework the code to test TMPDIR and COREBASE for all the patterns since they may be set differently and one may contain problematic characters. [YOCTO #14111] (From OE-Core rev: f22a6e46d003aba516a9a0cc7f94eae678d846b7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sanity.bbclass')
-rw-r--r--meta/classes/sanity.bbclass21
1 files changed, 12 insertions, 9 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 14ffac0bf2..a377917f2a 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -882,15 +882,18 @@ def check_sanity_everybuild(status, d):
882 except: 882 except:
883 pass 883 pass
884 884
885 oeroot = d.getVar('COREBASE') 885 for checkdir in ['COREBASE', 'TMPDIR']:
886 if oeroot.find('+') != -1: 886 val = d.getVar(checkdir)
887 status.addresult("Error, you have an invalid character (+) in your COREBASE directory path. Please move the installation to a directory which doesn't include any + characters.") 887 if val.find('..') != -1:
888 if oeroot.find('@') != -1: 888 status.addresult("Error, you have '..' in your %s directory path. Please ensure the variable contains an absolute path as this can break some recipe builds in obtuse ways." % checkdir)
889 status.addresult("Error, you have an invalid character (@) in your COREBASE directory path. Please move the installation to a directory which doesn't include any @ characters.") 889 if val.find('+') != -1:
890 if oeroot.find('%') != -1: 890 status.addresult("Error, you have an invalid character (+) in your %s directory path. Please move the installation to a directory which doesn't include any + characters." % checkdir)
891 status.addresult("Error, you have an invalid character (%) in your COREBASE directory path which causes problems with python string formatting. Please move the installation to a directory which doesn't include any % characters.") 891 if val.find('@') != -1:
892 if oeroot.find(' ') != -1: 892 status.addresult("Error, you have an invalid character (@) in your %s directory path. Please move the installation to a directory which doesn't include any @ characters." % checkdir)
893 status.addresult("Error, you have a space in your COREBASE directory path. Please move the installation to a directory which doesn't include a space since autotools doesn't support this.") 893 if val.find(' ') != -1:
894 status.addresult("Error, you have a space in your %s directory path. Please move the installation to a directory which doesn't include a space since autotools doesn't support this." % checkdir)
895 if val.find('%') != -1:
896 status.addresult("Error, you have an invalid character (%) in your %s directory path which causes problems with python string formatting. Please move the installation to a directory which doesn't include any % characters." % checkdir)
894 897
895 # Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS 898 # Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS
896 import re 899 import re