diff options
authorPaul Eggleton <paul.eggleton@linux.intel.com>2018-04-04 17:06:29 +1200
committerPaul Eggleton <paul.eggleton@linux.intel.com>2018-04-04 22:59:29 +1200
commitb7c956a8e21f3de178b35c9a70ce60c7900e9bf7 (patch)
parent2a8dd808adeef0efed679f04f2310cb9bf36827e (diff)
classes/externalsrc: ensure cleandirs code handles non-absolute pathspaule/externalsrc-cleandirs-fixes
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@linux.intel.com>
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index ce8517c58b..c9f5cf767d 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)):
setvalue = True
if setvalue: