From 542ad9696f50e33fa20e735c14c052720c55bc3a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 23 Aug 2019 14:35:53 +0200 Subject: dry_run --- libbuild2/version/init.cxx | 3 ++- libbuild2/version/rule.cxx | 3 ++- libbuild2/version/utility.cxx | 9 ++++++--- libbuild2/version/utility.hxx | 6 +++++- 4 files changed, 15 insertions(+), 6 deletions(-) (limited to 'libbuild2/version') diff --git a/libbuild2/version/init.cxx b/libbuild2/version/init.cxx index 1c123bf..123dc65 100644 --- a/libbuild2/version/init.cxx +++ b/libbuild2/version/init.cxx @@ -374,7 +374,8 @@ namespace build2 // try { - auto_rmfile t (fixup_manifest (f, + auto_rmfile t (fixup_manifest (rs.ctx, + f, path::temp_path ("manifest"), m.version)); diff --git a/libbuild2/version/rule.cxx b/libbuild2/version/rule.cxx index 37e6b0f..fe999b3 100644 --- a/libbuild2/version/rule.cxx +++ b/libbuild2/version/rule.cxx @@ -328,7 +328,8 @@ namespace build2 // the out tree. Somehow the latter feels more appropriate (even though // if we crash in between, we won't clean it up). // - return fixup_manifest (p, rs.out_path () / "manifest.t", m.version); + return fixup_manifest ( + t.ctx, p, rs.out_path () / "manifest.t", m.version); } } } diff --git a/libbuild2/version/utility.cxx b/libbuild2/version/utility.cxx index 70daab1..0669da7 100644 --- a/libbuild2/version/utility.cxx +++ b/libbuild2/version/utility.cxx @@ -17,11 +17,14 @@ namespace build2 namespace version { auto_rmfile - fixup_manifest (const path& in, path out, const standard_version& v) + fixup_manifest (context& ctx, + const path& in, + path out, + const standard_version& v) { - auto_rmfile r (move (out), !dry_run /* active */); + auto_rmfile r (move (out), !ctx.dry_run /* active */); - if (!dry_run) + if (!ctx.dry_run) { try { diff --git a/libbuild2/version/utility.hxx b/libbuild2/version/utility.hxx index 16e8c78..170488d 100644 --- a/libbuild2/version/utility.hxx +++ b/libbuild2/version/utility.hxx @@ -8,6 +8,7 @@ #include #include +#include #include namespace build2 @@ -18,7 +19,10 @@ namespace build2 // not preserve comments. Probably acceptable for snapshots. // auto_rmfile - fixup_manifest (const path& in, path out, const standard_version&); + fixup_manifest (context&, + const path& in, + path out, + const standard_version&); } } -- cgit v1.1