From 09d60452a80d14d9b8bf3a9395860b50683fa1e8 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 3 Sep 2018 23:33:06 +0300 Subject: Ignore directories with .buildignore file when generating names with wildcard patterns --- build2/parser.cxx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/build2/parser.cxx b/build2/parser.cxx index 4f532fc..c6b6b45 100644 --- a/build2/parser.cxx +++ b/build2/parser.cxx @@ -3011,22 +3011,24 @@ namespace build2 function&&)> appf; if (unique) appf = [a, &append] (string&& v, optional&& e) - { - append (move (v), move (e), a); - }; + { + append (move (v), move (e), a); + }; else appf = [a, &include_match] (string&& v, optional&& e) - { - include_match (move (v), move (e), a); - }; + { + include_match (move (v), move (e), a); + }; - auto process = [&e, &appf] (path&& m, const string& p, bool interm) + auto process = [&e, &appf, sp] (path&& m, const string& p, bool interm) { // Ignore entries that start with a dot unless the pattern that - // matched them also starts with a dot. + // matched them also starts with a dot. Also ignore directories + // containing the .buildignore file. // const string& s (m.string ()); - if (p[0] != '.' && s[path::traits::find_leaf (s)] == '.') + if ((p[0] != '.' && s[path::traits::find_leaf (s)] == '.') || + (m.to_directory () && file_exists (*sp / m / ".buildignore"))) return !interm; // Note that we have to make copies of the extension since there will -- cgit v1.1