commit 44e5c0031b37b9e31a569056cb353979ca5ae431
parent dda673cdcb3c2383ed8181c92dc9d1c9ff8a1c05
Author: cfillion <cfillion@users.noreply.github.com>
Date: Thu, 24 Mar 2016 21:00:26 -0400
receipt: don't add extra new lines after upgates and error sections
Diffstat:
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/report.cpp b/src/report.cpp
@@ -132,11 +132,16 @@ void Report::printUpdates()
{
printHeader("Updates");
+ const auto start = stream().tellp();
+
for(const InstallTicket &ticket : m_receipt->updates()) {
const Package *pkg = ticket.version->package();
const Registry::Entry ®Entry = ticket.regEntry;
const VersionSet &versions = pkg->versions();
+ if(stream().tellp() != start)
+ stream() << NL;
+
stream() << pkg->fullName() << ':' << NL;
for(const Version *ver : versions | boost::adaptors::reversed) {
@@ -145,8 +150,6 @@ void Report::printUpdates()
printVersion(ver);
}
-
- stream() << NL;
}
}
@@ -154,10 +157,14 @@ void Report::printErrors()
{
printHeader("Errors");
+ const auto start = stream().tellp();
+
for(const Receipt::Error &err : m_receipt->errors()) {
+ if(stream().tellp() != start)
+ stream() << NL;
+
stream() << err.title << ':' << NL;
printIndented(err.message);
- stream() << "\n";
}
}