From 4854da9ba94fc107ff3dcd7eac4e12cecacd9b2e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 7 Mar 2016 14:37:08 +0200 Subject: Remove the depdb (.d) files when cleaning --- build2/context.txx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'build2/context.txx') diff --git a/build2/context.txx b/build2/context.txx index 566beb1..3233092 100644 --- a/build2/context.txx +++ b/build2/context.txx @@ -8,10 +8,15 @@ namespace build2 { template fs_status - rmfile (const path& f, const T& t) + rmfile (const path& f, const T& t, bool verbose) { using namespace butl; + // Verbosity thresholds. + // + uint16_t l1 (verbose ? 2 : 3); + uint16_t l2 (verbose ? 1 : 3); + // We don't want to print the command if we couldn't remove the // file because it does not exist (just like we don't print the // update command if the file is up to date). This makes the @@ -25,9 +30,9 @@ namespace build2 } catch (const system_error& e) { - if (verb >= 2) + if (verb >= l1) text << "rm " << f; - else if (verb) + else if (verb >= l2) text << "rm " << t; fail << "unable to remove file " << f << ": " << e.what (); @@ -35,9 +40,9 @@ namespace build2 if (rs == rmfile_status::success) { - if (verb >= 2) + if (verb >= l1) text << "rm " << f; - else if (verb) + else if (verb >= l2) text << "rm " << t; } -- cgit v1.1