commit 65a12768b79fbab029ac1a5711e3af0f3db572c0 parent 5a5da02e44bf3933f63a59914f7a8c356c32b423 Author: cfillion <cfillion@users.noreply.github.com> Date: Mon, 9 May 2016 22:11:03 -0400 pkg contents: mark main files with an asterisk Diffstat:
M | src/report.cpp | | | 15 | +++++++++++++-- |
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/report.cpp b/src/report.cpp @@ -20,6 +20,7 @@ #include "encoding.hpp" #include "package.hpp" #include "resource.hpp" +#include "source.hpp" #include "transaction.hpp" #include <boost/range/adaptor/reversed.hpp> @@ -216,7 +217,17 @@ void Contents::fillReport() stream() << NL; printVersion(ver); - for(const Path &file : ver->files()) - printIndented(file.join()); + + const auto &sources = ver->sources(); + for(auto it = sources.begin(); it != sources.end();) { + const Path &path = it->first; + const string &file = path.join(); + const Source *src = it->second; + + printIndented(src->isMain() ? file + '*' : file); + + // skip duplicate files + do { it++; } while(it != sources.end() && path == it->first); + } } }