aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-09-11 13:24:57 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2024-09-11 13:24:57 +0300
commitf52692fe3ababd89d2c60a31291a5075a031b5d9 (patch)
tree187eb85494a4499dad43a63c8200434d8b941226
parentcedf1eb8d6aa33c6bdf3c7d65095f08dc2e9d81e (diff)
Make b-dist in bootstrap mode to ignore .git*, .bdep, .bpkg, and .build2 file targets rather than .*
-rw-r--r--libbuild2/dist/operation.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/libbuild2/dist/operation.cxx b/libbuild2/dist/operation.cxx
index dd1c87b..6dc830b 100644
--- a/libbuild2/dist/operation.cxx
+++ b/libbuild2/dist/operation.cxx
@@ -155,8 +155,12 @@ namespace build2
for (const dir_entry& e: dir_iterator (d, dir_iterator::no_follow))
{
const path& n (e.path ());
+ const string& s (n.string ());
- if (!n.empty () && n.string ().front () != '.')
+ if (s.compare (0, 4, ".git") != 0 &&
+ s != ".bdep" &&
+ s != ".bpkg" &&
+ s != ".build2")
try
{
if (e.type () == entry_type::directory) // Can throw.
@@ -643,8 +647,8 @@ namespace build2
{
l5 ([&]{trace << "bootstrap dist " << rs;});
- // Recursively enter/collect file targets in src_root ignoring those
- // that start with a dot.
+ // Recursively enter/collect file targets in src_root ignoring the
+ // following ones: .git*, .bdep, .bpkg, and .build2.
//
// Note that, in particular, we also collect the symlinks which point
// outside src_root (think of third-party project packaging with the