From 76bae701a899dc7bec18a6f20ded9f85c6367b0c Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Wed, 9 Mar 2016 19:36:35 -0300 Subject: [PATCH] waf: exclude build directory in collect_dirs_to_recurse() Without this patch, if nodes that don't yet exist in the filesystem in bld.bldnode were created before calls to this function, they'll be removed from the tree in memory because "*" is passed to ant_glob() and the "remove" keyword argument defaults to True. --- wscript | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wscript b/wscript index dfc58f2770..5a85f2b8d3 100644 --- a/wscript +++ b/wscript @@ -119,6 +119,11 @@ def configure(cfg): def collect_dirs_to_recurse(bld, globs, **kw): dirs = [] globs = Utils.to_list(globs) + + if bld.bldnode.is_child_of(bld.srcnode): + kw['excl'] = Utils.to_list(kw.get('excl', [])) + kw['excl'].append(bld.bldnode.path_from(bld.srcnode)) + for g in globs: for d in bld.srcnode.ant_glob(g + '/wscript', **kw): dirs.append(d.parent.relpath())