diff options
Diffstat (limited to 'libbuild2')
-rw-r--r-- | libbuild2/cc/link-rule.cxx | 2 | ||||
-rw-r--r-- | libbuild2/file.hxx | 5 | ||||
-rw-r--r-- | libbuild2/filesystem.hxx | 3 | ||||
-rw-r--r-- | libbuild2/parser.cxx | 24 |
4 files changed, 26 insertions, 8 deletions
diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx index 2037a5a..d43e7e8 100644 --- a/libbuild2/cc/link-rule.cxx +++ b/libbuild2/cc/link-rule.cxx @@ -2598,7 +2598,7 @@ namespace build2 // if (*md->for_install != *d.for_install) fail << "incompatible " << *l << " build" << - info << "library is already updated but " + info << "target is already updated but " << (*md->for_install ? "" : "not ") << "for install"; } diff --git a/libbuild2/file.hxx b/libbuild2/file.hxx index 36e4c00..ff8a821 100644 --- a/libbuild2/file.hxx +++ b/libbuild2/file.hxx @@ -30,8 +30,9 @@ namespace build2 // export.build -- export stub // export/ -- exported buildfiles // - // The build/, bootstrap/, root/, and config.build entries are in .gitignore - // as generated by bdep-new. + // The build/, /bootstrap/, /root/, and config.build entries are in + // .gitignore as generated by bdep-new (note that build/ is ignored + // recursively; see below). // // The rest of the filesystem entries are shared between the project and the // modules that it loads. In particular, if a project loads module named diff --git a/libbuild2/filesystem.hxx b/libbuild2/filesystem.hxx index 7b45a08..44f5d92 100644 --- a/libbuild2/filesystem.hxx +++ b/libbuild2/filesystem.hxx @@ -24,6 +24,9 @@ namespace build2 { using butl::entry_type; + using butl::dir_entry; + using butl::dir_iterator; + using butl::auto_rmfile; using butl::auto_rmdir; diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx index e6fd5bb..cb1bccc 100644 --- a/libbuild2/parser.cxx +++ b/libbuild2/parser.cxx @@ -2385,9 +2385,16 @@ namespace build2 // size_t b (0), e (0); for (size_t m (0), n (text.size ()); - next_word (text, n, b, e, m, '\n', '\r'), b != n; - sloc.line++) + next_word (text, n, b, e, m, '\n', '\r'), b != n; ) { + // Treat consecutive \r\n (CRLF) as if they were a single + // delimiter. + // + if (b != 0 && text[b - 1] == '\r' && + e != n && text[e] == '\n' && + m != 2) + continue; + s.assign (text, b, e - b); if (!trim (s).empty ()) @@ -2401,6 +2408,8 @@ namespace build2 break; } } + + sloc.line++; } if (b == e) @@ -7264,7 +7273,9 @@ namespace build2 (root_ != nullptr && root_->root_extra != nullptr && m.to_directory () && - exists (d.sp / m / root_->root_extra->buildignore_file))) + exists (m.relative () + ? d.sp / m / root_->root_extra->buildignore_file + : m / root_->root_extra->buildignore_file))) return !interm; // Note that we have to make copies of the extension since there will @@ -7320,9 +7331,11 @@ namespace build2 return true; }); + path pat (move (p)); + try { - path_search (path (move (p)), + path_search (pat, process, *sp, path_match_flags::follow_symlinks, @@ -7330,7 +7343,8 @@ namespace build2 } catch (const system_error& e) { - fail (l) << "unable to scan " << *sp << ": " << e; + fail (l) << "unable to scan for '" + << (pat.relative () ? *sp / pat : pat) << "': " << e; } }; |