From 467d700c66582471013a07384318d0142d2f3de2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 3 Aug 2015 17:58:46 +0200 Subject: Fix few bugs --- build/algorithm.ixx | 3 ++- build/context.txx | 2 +- build/rule.cxx | 9 +++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'build') diff --git a/build/algorithm.ixx b/build/algorithm.ixx index ce581c5..bb66b53 100644 --- a/build/algorithm.ixx +++ b/build/algorithm.ixx @@ -126,7 +126,8 @@ namespace build switch (target_state ts = t.state ()) { case target_state::unchanged: - case target_state::changed: return ts; + case target_state::changed: + return ts; default: { // Handle the "last" execution mode. diff --git a/build/context.txx b/build/context.txx index b9004e0..eb1568c 100644 --- a/build/context.txx +++ b/build/context.txx @@ -52,7 +52,7 @@ namespace build { using namespace butl; - bool w (d == work); // Don't try to remove working directory. + bool w (work.sub (d)); // Don't try to remove working directory. rmdir_status rs; // We don't want to print the command if we couldn't remove the diff --git a/build/rule.cxx b/build/rule.cxx index 9f17a2c..97cd20f 100644 --- a/build/rule.cxx +++ b/build/rule.cxx @@ -242,8 +242,13 @@ namespace build // switch (rs) { - case rmdir_status::success: ts |= target_state::changed; - case rmdir_status::not_empty: ts |= target_state::postponed; + case rmdir_status::success: ts |= target_state::changed; break; + case rmdir_status::not_empty: + { + if (!work.sub (t.dir)) // No use postponing removing working directory. + ts |= target_state::postponed; + break; + } default: break; } -- cgit v1.1