aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-01-26 14:48:29 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-01-26 14:48:29 +0000
commit22f38487876630e97e4df4ea9573139c2c630c21 (patch)
tree6dc5a5db395a597d734df3adc6098cf2e277eb6a
parentf91f8744cdc3d0517aee34e7b393b44280375734 (diff)
downloadpaludis-22f38487876630e97e4df4ea9573139c2c630c21.tar.gz
paludis-22f38487876630e97e4df4ea9573139c2c630c21.tar.xz
want to flush when there're summary messages
-rw-r--r--paludis/file_output_manager.cc11
-rw-r--r--paludis/forward_at_finish_output_manager.cc9
2 files changed, 16 insertions, 4 deletions
diff --git a/paludis/file_output_manager.cc b/paludis/file_output_manager.cc
index e0b9423..75ff585 100644
--- a/paludis/file_output_manager.cc
+++ b/paludis/file_output_manager.cc
@@ -42,7 +42,7 @@ namespace paludis
const std::tr1::shared_ptr<OutputManager> summary_output_manager;
const std::string summary_output_message;
- bool succeeded, unlinked;
+ bool succeeded, unlinked, nothing_more_to_come;
Implementation(
const FSEntry & o,
@@ -59,7 +59,8 @@ namespace paludis
summary_output_manager(m),
summary_output_message(s),
succeeded(false),
- unlinked(false)
+ unlinked(false),
+ nothing_more_to_come(false)
{
}
};
@@ -120,12 +121,16 @@ FileOutputManager::flush()
bool
FileOutputManager::want_to_flush() const
{
- return false;
+ return _imp->nothing_more_to_come &&
+ (! _imp->unlinked) &&
+ (! _imp->summary_output_message.empty());
}
void
FileOutputManager::nothing_more_to_come()
{
+ _imp->nothing_more_to_come = true;
+
if (! _imp->stdout_stream)
return;
diff --git a/paludis/forward_at_finish_output_manager.cc b/paludis/forward_at_finish_output_manager.cc
index 8c2a38b..964aff4 100644
--- a/paludis/forward_at_finish_output_manager.cc
+++ b/paludis/forward_at_finish_output_manager.cc
@@ -39,6 +39,7 @@ namespace paludis
const bool if_success, if_failure;
const std::tr1::shared_ptr<OutputManager> child;
bool success;
+ bool nothing_more_to_come;
Implementation(
const bool s,
@@ -48,7 +49,8 @@ namespace paludis
if_success(s),
if_failure(f),
child(m),
- success(false)
+ success(false),
+ nothing_more_to_come(false)
{
}
};
@@ -107,6 +109,9 @@ ForwardAtFinishOutputManager::flush()
bool
ForwardAtFinishOutputManager::want_to_flush() const
{
+ if (_imp->nothing_more_to_come && ((! _imp->stdout_stream.str().empty()) || (! _imp->stderr_stream.str().empty())))
+ return true;
+
return false;
}
@@ -118,6 +123,8 @@ ForwardAtFinishOutputManager::nothing_more_to_come()
_imp->stdout_stream.clear();
_imp->stderr_stream.clear();
}
+
+ _imp->nothing_more_to_come = true;
}
const std::tr1::shared_ptr<const Set<std::string> >