aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/filesystem.txx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-08-23 14:35:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-08-23 14:35:53 +0200
commit542ad9696f50e33fa20e735c14c052720c55bc3a (patch)
treeded3e6dbbc09d79d44c32a48c6f75df0e35ef017 /libbuild2/filesystem.txx
parent0ca011d1220207b3c1cba92791413f113ec66329 (diff)
dry_run
Diffstat (limited to 'libbuild2/filesystem.txx')
-rw-r--r--libbuild2/filesystem.txx9
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;
}