aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--paludis/pretty_print_options.se1
-rw-r--r--paludis/repositories/e/pipe_command_handler.cc14
-rw-r--r--paludis/repositories/e/spec_tree_pretty_printer.cc29
-rw-r--r--paludis/repositories/e/vdb_repository.cc28
4 files changed, 66 insertions, 6 deletions
diff --git a/paludis/pretty_print_options.se b/paludis/pretty_print_options.se
index 62e02020e..749e8d033 100644
--- a/paludis/pretty_print_options.se
+++ b/paludis/pretty_print_options.se
@@ -6,5 +6,6 @@ make_enum_PrettyPrintOption()
prefix ppo
key ppo_multiline_allowed "Print over multiple lines if appropriate"
+ key ppo_include_special_annotations "Include dsak_expanded and dsak_synthetic annotations"
}
diff --git a/paludis/repositories/e/pipe_command_handler.cc b/paludis/repositories/e/pipe_command_handler.cc
index 51940de04..a8e86d69c 100644
--- a/paludis/repositories/e/pipe_command_handler.cc
+++ b/paludis/repositories/e/pipe_command_handler.cc
@@ -123,6 +123,20 @@ namespace
for (auto m(p.maybe_annotations()->begin()), m_end(p.maybe_annotations()->end()) ;
m != m_end ; ++m)
{
+ switch (m->kind())
+ {
+ case dsak_literal:
+ case dsak_expandable:
+ break;
+
+ case dsak_synthetic:
+ case dsak_expanded:
+ continue;
+
+ case last_dsak:
+ throw InternalError(PALUDIS_HERE, "bad kind");
+ }
+
if (! done_brackets)
{
str << " [[ ";
diff --git a/paludis/repositories/e/spec_tree_pretty_printer.cc b/paludis/repositories/e/spec_tree_pretty_printer.cc
index 35caadfee..da9996a59 100644
--- a/paludis/repositories/e/spec_tree_pretty_printer.cc
+++ b/paludis/repositories/e/spec_tree_pretty_printer.cc
@@ -22,6 +22,7 @@
#include <paludis/util/save.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/pimp-impl.hh>
+#include <paludis/util/stringify.hh>
#include <paludis/pretty_printer.hh>
#include <paludis/dep_spec_annotations.hh>
#include <algorithm>
@@ -530,16 +531,38 @@ SpecTreePrettyPrinter::visit(const GenericSpecTree::NodeType<DependenciesLabelsD
void
SpecTreePrettyPrinter::do_annotations(const DepSpec & p)
{
- if (p.maybe_annotations() && (p.maybe_annotations()->begin() != p.maybe_annotations()->end()))
+ if (p.maybe_annotations())
{
- _imp->s << " [[ ";
+ bool done_open(false);
for (auto m(p.maybe_annotations()->begin()), m_end(p.maybe_annotations()->end()) ;
m != m_end ; ++m)
{
+ switch (m->kind())
+ {
+ case dsak_literal:
+ case dsak_expandable:
+ break;
+
+ case dsak_synthetic:
+ case dsak_expanded:
+ if (! _imp->options[ppo_include_special_annotations])
+ continue;
+ break;
+
+ case last_dsak:
+ throw InternalError(PALUDIS_HERE, "bad dsak. huh?");
+ }
+
+ if (! done_open)
+ _imp->s << " [[ ";
+ done_open = true;
+
_imp->s << m->key() << " = [" << (m->value().empty() ? " " : " " + m->value() + " ") << "] ";
}
- _imp->s << "]]";
+
+ if (done_open)
+ _imp->s << "]]";
}
}
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 01edb0009..020608980 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -1210,13 +1210,35 @@ namespace
void do_annotations(const DepSpec & p)
{
- if (p.maybe_annotations() && (p.maybe_annotations()->begin() != p.maybe_annotations()->end()))
+ if (p.maybe_annotations())
{
- str << " [[ ";
+ bool done_open(false);
for (auto m(p.maybe_annotations()->begin()), m_end(p.maybe_annotations()->end()) ;
m != m_end ; ++m)
+ {
+ switch (m->kind())
+ {
+ case dsak_literal:
+ case dsak_expandable:
+ break;
+
+ case dsak_expanded:
+ case dsak_synthetic:
+ continue;
+
+ case last_dsak:
+ throw InternalError(PALUDIS_HERE, "bad dsak. huh?");
+ }
+
+ if (! done_open)
+ str << " [[ ";
+ done_open = true;
+
str << m->key() << " = [" << (m->value().empty() ? " " : " " + m->value() + " ") << "] ";
- str << "]] ";
+ }
+
+ if (done_open)
+ str << "]] ";
}
}