All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Anuj Mittal" <anuj.mittal@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [gatesgarth][PATCH 8/8] sanity: Further improve directory sanity tests
Date: Mon, 26 Apr 2021 13:45:46 +0800	[thread overview]
Message-ID: <8b0aef3f504d650c3208f11b62a7926aa90967f1.1619409036.git.anuj.mittal@intel.com> (raw)
In-Reply-To: <cover.1619409036.git.anuj.mittal@intel.com>

From: Richard Purdie <richard.purdie@linuxfoundation.org>

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]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit f22a6e46d003aba516a9a0cc7f94eae678d846b7)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 meta/classes/sanity.bbclass | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index c450b37bf0..03a9792f68 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -882,15 +882,18 @@ def check_sanity_everybuild(status, d):
         except:
             pass
 
-    oeroot = d.getVar('COREBASE')
-    if oeroot.find('+') != -1:
-        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.")
-    if oeroot.find('@') != -1:
-        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.")
-    if oeroot.find('%') != -1:
-        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.") 
-    if oeroot.find(' ') != -1:
-        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.")
+    for checkdir in ['COREBASE', 'TMPDIR']:
+        val = d.getVar(checkdir)
+        if val.find('..') != -1:
+            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)
+        if val.find('+') != -1:
+            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)
+        if val.find('@') != -1:
+            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)
+        if val.find(' ') != -1:
+            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)
+        if val.find('%') != -1:
+            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)
 
     # Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS
     import re
-- 
2.30.2


      parent reply	other threads:[~2021-04-26  5:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26  5:45 [gatesgarth][PATCH 0/8] review request Anuj Mittal
2021-04-26  5:45 ` [gatesgarth][PATCH 1/8] cve-update-db-native: skip on empty cpe23Uri Anuj Mittal
2021-04-26  5:45 ` [gatesgarth][PATCH 2/8] linux-yocto/5.4: update to v5.4.109 Anuj Mittal
2021-04-26  5:45 ` [gatesgarth][PATCH 3/8] linux-yocto/5.4: update to v5.4.111 Anuj Mittal
2021-04-26  5:45 ` [gatesgarth][PATCH 4/8] linux-yocto/5.4: update to v5.4.112 Anuj Mittal
2021-04-26  5:45 ` [gatesgarth][PATCH 5/8] linux-yocto/5.4: fix arm defconfig warnings Anuj Mittal
2021-04-26  5:45 ` [gatesgarth][PATCH 6/8] ca-certificates: Fix openssl runtime cert dependencies Anuj Mittal
2021-04-26  5:45 ` [gatesgarth][PATCH 7/8] kmod: do not symlink config.guess/config.sub during autoreconf Anuj Mittal
2021-04-26  5:45 ` Anuj Mittal [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8b0aef3f504d650c3208f11b62a7926aa90967f1.1619409036.git.anuj.mittal@intel.com \
    --to=anuj.mittal@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.