aboutsummaryrefslogtreecommitdiff
path: root/build2/operation.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-02-21 10:29:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-02-21 10:29:03 +0200
commit0dc03d406a9958adb27ff49f568685f6e80f01ce (patch)
treefe51d02935c81a27ffd82f21d0d4275432019ffe /build2/operation.cxx
parent75fc95426f2028044f3e1fccef261e76cda69892 (diff)
Add progress to dist meta-operation
Diffstat (limited to 'build2/operation.cxx')
-rw-r--r--build2/operation.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/build2/operation.cxx b/build2/operation.cxx
index eaacc6d..dabebcc 100644
--- a/build2/operation.cxx
+++ b/build2/operation.cxx
@@ -112,7 +112,7 @@ namespace build2
}
void
- match (const values&, action a, action_targets& ts, uint16_t diag)
+ match (const values&, action a, action_targets& ts, uint16_t diag, bool prog)
{
tracer trace ("match");
@@ -126,8 +126,8 @@ namespace build2
//
string what; // Note: must outlive monitor_guard.
scheduler::monitor_guard mg;
- if (ops.progress () ||
- (stderr_term && verb >= 1 && verb <= 2 && !ops.no_progress ()))
+
+ if (prog && show_progress (2 /* max_verb */))
{
size_t incr (stderr_term ? 1 : 10); // Scale depending on output type.
@@ -240,7 +240,8 @@ namespace build2
}
void
- execute (const values&, action a, action_targets& ts, uint16_t diag)
+ execute (const values&, action a, action_targets& ts,
+ uint16_t diag, bool prog)
{
tracer trace ("execute");
@@ -265,12 +266,10 @@ namespace build2
string what; // Note: must outlive monitor_guard.
scheduler::monitor_guard mg;
- if (ops.progress () || (stderr_term && verb == 1 && !ops.no_progress ()))
+ if (prog && show_progress (1 /* max_verb */))
{
size_t init (target_count.load (memory_order_relaxed));
- size_t incr (init / 100); // 1%.
- if (incr == 0)
- incr = 1;
+ size_t incr (init > 100 ? init / 100 : 1); // 1%.
if (init != incr)
{
@@ -476,7 +475,7 @@ namespace build2
}
static void
- info_execute (const values&, action, action_targets& ts, uint16_t)
+ info_execute (const values&, action, action_targets& ts, uint16_t, bool)
{
for (size_t i (0); i != ts.size (); ++i)
{