aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-09-03 23:33:06 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-09-03 23:33:06 +0300
commit09d60452a80d14d9b8bf3a9395860b50683fa1e8 (patch)
tree04d0034941767d53e298ba4356d4ea9175bdcb5e
parent5996f8b2ae95be1e5429acc1499c05ff60bcc79a (diff)
Ignore directories with .buildignore file when generating names with wildcard patterns
-rw-r--r--build2/parser.cxx20
1 files 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<void (string&&, optional<string>&&)> appf;
if (unique)
appf = [a, &append] (string&& v, optional<string>&& e)
- {
- append (move (v), move (e), a);
- };
+ {
+ append (move (v), move (e), a);
+ };
else
appf = [a, &include_match] (string&& v, optional<string>&& 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