aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-10 13:44:44 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-10 16:18:14 +0000
commit42f4775a160a10107f513aa271d1f199c86ce239 (patch)
treef182fc115c20acb39a6d55c0186095b7a475b6be
parent69b9f6756b9e7817e14eb9c3c0fe22322f8f462a (diff)
downloadpaludis-42f4775a160a10107f513aa271d1f199c86ce239.tar.gz
paludis-42f4775a160a10107f513aa271d1f199c86ce239.tar.xz
Don't print special annotations
-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 62e0202..749e8d0 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 51940de..a8e86d6 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 35caadf..da9996a 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 01edb00..0206089 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 << "]] ";
}
}