[oe-commits] [openembedded-core] 02/23: classes/externalsrc: ensure cleandirs code handles non-absolute paths

git at git.openembedded.org git at git.openembedded.org
Thu Apr 5 13:57:50 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 87ec0fb470274d980f8553a85f778809c269c5d7
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Wed Apr 4 23:02:36 2018 +1200

    classes/externalsrc: ensure cleandirs code handles non-absolute paths
    
    It's possible that a trailing or extra slash somewhere in the external
    source path could result in the directory not being removed from
    cleandirs; it's also possible that a cleandirs entry is somewhere
    underneath the source tree and that tree should never have parts of it
    deleted by the build system. Use oe.path.is_path_parent() (which makes
    paths absolute before checking them) to find out if any path in
    cleandirs is anywhere underneath the external source path, and drop it
    if it is.
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/externalsrc.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index ce8517c..c9f5cf7 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -54,6 +54,7 @@ python () {
 
     if externalsrc:
         import oe.recipeutils
+        import oe.path
 
         d.setVar('S', externalsrc)
         if externalsrcbuild:
@@ -90,7 +91,7 @@ python () {
             cleandirs = oe.recipeutils.split_var_value(d.getVarFlag(task, 'cleandirs', False) or '')
             setvalue = False
             for cleandir in cleandirs[:]:
-                if d.expand(cleandir) == externalsrc:
+                if oe.path.is_path_parent(externalsrc, d.expand(cleandir)):
                     cleandirs.remove(cleandir)
                     setvalue = True
             if setvalue:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list