diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-22 14:38:57 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-23 18:14:07 +0200 |
commit | 5035f4ef68922ac758b1e4734e67d73c9228010b (patch) | |
tree | 271fdd5b1d6e995a058d97aacb3ac90a538d9ff1 /libbuild2/filesystem.txx | |
parent | 8793941652d6aa1c3d02b2f87f691e6d06254b7d (diff) |
Introduce notion of build context
All non-const global state is now in class context and we can now have
multiple independent builds going on at the same time.
Diffstat (limited to 'libbuild2/filesystem.txx')
-rw-r--r-- | libbuild2/filesystem.txx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libbuild2/filesystem.txx b/libbuild2/filesystem.txx index 057975a..e3cdef3 100644 --- a/libbuild2/filesystem.txx +++ b/libbuild2/filesystem.txx @@ -4,14 +4,13 @@ #include <type_traits> // is_base_of -#include <libbuild2/context.hxx> // dry_run #include <libbuild2/diagnostics.hxx> namespace build2 { template <typename T> fs_status<butl::rmfile_status> - rmfile (const path& f, const T& t, uint16_t v) + rmfile (context& ctx, const path& f, const T& t, uint16_t v) { using namespace butl; @@ -34,7 +33,7 @@ namespace build2 try { - rs = dry_run + rs = ctx.dry_run ? file_exists (f) ? rmfile_status::success : rmfile_status::not_exist : try_rmfile (f); } @@ -52,7 +51,7 @@ namespace build2 template <typename T> fs_status<butl::rmdir_status> - rmdir (const dir_path& d, const T& t, uint16_t v) + rmdir (context& ctx, const dir_path& d, const T& t, uint16_t v) { using namespace butl; @@ -75,7 +74,7 @@ namespace build2 rmdir_status rs; try { - rs = dry_run + rs = ctx.dry_run ? dir_exists (d) ? rmdir_status::success : rmdir_status::not_exist : !(w = work.sub (d)) ? try_rmdir (d) : rmdir_status::not_empty; } |