aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-08-03 17:58:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-08-03 17:58:46 +0200
commit467d700c66582471013a07384318d0142d2f3de2 (patch)
tree3b702d291f50f6ec9989e72edc567cd0befd0998
parentabb7bf1045fde14f6ef87c8941ee22af233af397 (diff)
Fix few bugs
-rw-r--r--build/algorithm.ixx3
-rw-r--r--build/context.txx2
-rw-r--r--build/rule.cxx9
3 files changed, 10 insertions, 4 deletions
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;
}