aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories/e')
-rw-r--r--paludis/repositories/e/Makefile.am15
-rw-r--r--paludis/repositories/e/dep_parser_TEST.cc78
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer.cc603
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer.hh121
-rw-r--r--paludis/repositories/e/depend_rdepend_TEST.cc1
-rw-r--r--paludis/repositories/e/e_choices_key.cc2
-rw-r--r--paludis/repositories/e/e_key.cc182
-rw-r--r--paludis/repositories/e/e_key.hh54
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc14
-rw-r--r--paludis/repositories/e/e_repository_TEST_0.cc2
-rw-r--r--paludis/repositories/e/e_repository_TEST_1.cc2
-rw-r--r--paludis/repositories/e/e_repository_TEST_2.cc2
-rw-r--r--paludis/repositories/e/e_repository_TEST_3.cc2
-rw-r--r--paludis/repositories/e/e_repository_TEST_4.cc3
-rw-r--r--paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc12
-rw-r--r--paludis/repositories/e/e_repository_TEST_ever.cc2
-rw-r--r--paludis/repositories/e/e_repository_TEST_exheres_0.cc2
-rw-r--r--paludis/repositories/e/e_repository_TEST_exlibs.cc2
-rw-r--r--paludis/repositories/e/e_repository_TEST_pbin.cc2
-rw-r--r--paludis/repositories/e/e_repository_TEST_phases.cc2
-rw-r--r--paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc2
-rw-r--r--paludis/repositories/e/e_repository_sets_TEST.cc16
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc8
-rw-r--r--paludis/repositories/e/fix_locked_dependencies_TEST.cc18
-rw-r--r--paludis/repositories/e/info_metadata_key.cc16
-rw-r--r--paludis/repositories/e/info_metadata_key.hh2
-rw-r--r--paludis/repositories/e/pipe_command_handler.cc17
-rw-r--r--paludis/repositories/e/required_use_verifier.cc1
-rw-r--r--paludis/repositories/e/vdb_repository.cc20
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc12
30 files changed, 97 insertions, 1118 deletions
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index b9f2e6ef0..956e8f63e 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -28,7 +28,6 @@ noinst_HEADERS = \
dep_parser.hh \
dep_parser-se.hh \
dep_parser-fwd.hh \
- dep_spec_pretty_printer.hh \
dependencies_rewriter.hh \
do_fetch_action.hh \
do_info_action.hh \
@@ -101,7 +100,6 @@ libpaludiserepository_la_SOURCES = \
check_fetched_files_visitor.cc \
check_userpriv.cc \
dep_parser.cc \
- dep_spec_pretty_printer.cc \
dependencies_rewriter.cc \
do_fetch_action.cc \
do_info_action.cc \
@@ -374,17 +372,6 @@ e_repository_sets_TEST_LDADD = \
e_repository_sets_TEST_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
-dep_spec_pretty_printer_TEST_SOURCES = dep_spec_pretty_printer_TEST.cc
-
-dep_spec_pretty_printer_TEST_LDADD = \
- $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
- $(top_builddir)/paludis/util/test_extras.o \
- $(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la \
- $(top_builddir)/test/libtest.a \
- $(DYNAMIC_LD_LIBS)
-
-dep_spec_pretty_printer_CXXFLAGS = $(AM_CXXFLAGS) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
-
dep_parser_TEST_SOURCES = dep_parser_TEST.cc
dep_parser_TEST_LDADD = \
@@ -457,7 +444,6 @@ EXTRA_DIST = \
dep_parser-se.hh \
dep_parser-se.cc \
dep_parser_TEST.cc \
- dep_spec_pretty_printer_TEST.cc \
depend_rdepend_TEST.cc \
depend_rdepend_TEST_setup.sh \
depend_rdepend_TEST_cleanup.sh \
@@ -649,7 +635,6 @@ TESTS = \
exndbam_repository_TEST \
aa_visitor_TEST \
dep_parser_TEST \
- dep_spec_pretty_printer_TEST \
depend_rdepend_TEST \
e_repository_sets_TEST \
ebuild_flat_metadata_cache_TEST \
diff --git a/paludis/repositories/e/dep_parser_TEST.cc b/paludis/repositories/e/dep_parser_TEST.cc
index 8c49cd97a..c27a5f3bb 100644
--- a/paludis/repositories/e/dep_parser_TEST.cc
+++ b/paludis/repositories/e/dep_parser_TEST.cc
@@ -17,14 +17,14 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/e/dep_parser.hh>
+#include <paludis/repositories/e/spec_tree_pretty_printer.hh>
#include <paludis/repositories/e/eapi.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/package_database.hh>
-#include <paludis/stringify_formatter.hh>
+#include <paludis/unformatted_pretty_printer.hh>
#include <paludis/util/make_named_values.hh>
#include <sstream>
#include <test/test_framework.hh>
@@ -59,8 +59,8 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- StringifyFormatter ff;
- DepSpecPrettyPrinter d(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ UnformattedPrettyPrinter ff;
+ SpecTreePrettyPrinter d(ff, { });
parse_depend("",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "");
@@ -85,8 +85,8 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- StringifyFormatter ff;
- DepSpecPrettyPrinter d(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ UnformattedPrettyPrinter ff;
+ SpecTreePrettyPrinter d(ff, { });
parse_depend(" \n \t",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "");
@@ -111,8 +111,8 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- StringifyFormatter ff;
- DepSpecPrettyPrinter d(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ UnformattedPrettyPrinter ff;
+ SpecTreePrettyPrinter d(ff, { });
parse_depend("app-editors/vim",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "app-editors/vim");
@@ -129,7 +129,7 @@ namespace test_cases
void run()
{
- StringifyFormatter ff;
+ UnformattedPrettyPrinter ff;
TestEnvironment env;
const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
@@ -138,17 +138,17 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d1(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ SpecTreePrettyPrinter d1(ff, { });
parse_depend(">=app-editors/vim-6.4_alpha",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d1);
TEST_CHECK_EQUAL(stringify(d1), ">=app-editors/vim-6.4_alpha");
- DepSpecPrettyPrinter d2(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ SpecTreePrettyPrinter d2(ff, { });
parse_depend("=app-editors/vim-6.4_alpha-r1",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d2);
TEST_CHECK_EQUAL(stringify(d2), "=app-editors/vim-6.4_alpha-r1");
- DepSpecPrettyPrinter d3(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ SpecTreePrettyPrinter d3(ff, { });
parse_depend(">=app-editors/vim-6.4_alpha:one",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d3);
TEST_CHECK_EQUAL(stringify(d3), ">=app-editors/vim-6.4_alpha:one");
@@ -165,7 +165,7 @@ namespace test_cases
void run()
{
- StringifyFormatter ff;
+ UnformattedPrettyPrinter ff;
TestEnvironment env;
const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
@@ -174,7 +174,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ SpecTreePrettyPrinter d(ff, { });
parse_depend("app-editors/vim app-misc/hilite \nsys-apps/findutils",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "app-editors/vim app-misc/hilite sys-apps/findutils");
@@ -187,7 +187,7 @@ namespace test_cases
void run()
{
- StringifyFormatter ff;
+ UnformattedPrettyPrinter ff;
TestEnvironment env;
const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
@@ -196,7 +196,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ SpecTreePrettyPrinter d(ff, { });
parse_depend("|| ( one/one two/two )",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "|| ( one/one two/two )");
@@ -209,7 +209,7 @@ namespace test_cases
void run()
{
- StringifyFormatter ff;
+ UnformattedPrettyPrinter ff;
TestEnvironment env;
const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
@@ -218,7 +218,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ SpecTreePrettyPrinter d(ff, { });
parse_depend("|| ( one/one foo? ( two/two ) )",
&env, id, *EAPIData::get_instance()->eapi_from_string("0"))->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "|| ( one/one foo? ( two/two ) )");
@@ -226,7 +226,7 @@ namespace test_cases
TEST_CHECK_THROWS(parse_depend("|| ( one/one foo? ( two/two ) )",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
- DepSpecPrettyPrinter e(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ SpecTreePrettyPrinter e(ff, { });
parse_depend("|| ( one/one ( foo? ( two/two ) ) )",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(e);
TEST_CHECK_EQUAL(stringify(e), "|| ( one/one ( foo? ( two/two ) ) )");
@@ -243,7 +243,7 @@ namespace test_cases
void run()
{
- StringifyFormatter ff;
+ UnformattedPrettyPrinter ff;
TestEnvironment env;
const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
@@ -252,7 +252,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ SpecTreePrettyPrinter d(ff, { });
parse_depend(" ( one/one two/two ) ",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "one/one two/two");
@@ -269,7 +269,7 @@ namespace test_cases
void run()
{
- StringifyFormatter ff;
+ UnformattedPrettyPrinter ff;
TestEnvironment env;
const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
@@ -278,7 +278,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ SpecTreePrettyPrinter d(ff, { });
parse_depend("foo? ( one/one )", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "foo? ( one/one )");
}
@@ -294,7 +294,7 @@ namespace test_cases
void run()
{
- StringifyFormatter ff;
+ UnformattedPrettyPrinter ff;
TestEnvironment env;
const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
@@ -303,7 +303,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ SpecTreePrettyPrinter d(ff, { });
parse_depend("!foo? ( one/one )", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "!foo? ( one/one )");
}
@@ -315,7 +315,7 @@ namespace test_cases
void run()
{
- StringifyFormatter ff;
+ UnformattedPrettyPrinter ff;
TestEnvironment env;
const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
@@ -324,11 +324,11 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::shared_ptr<const PackageID>(), ff, 0, true, false);
+ SpecTreePrettyPrinter d(ff, { ppo_multiline_allowed });
parse_fetchable_uri("a\n->\tb", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "a -> b\n");
- DepSpecPrettyPrinter e(0, std::shared_ptr<const PackageID>(), ff, 0, true, false);
+ SpecTreePrettyPrinter e(ff, { ppo_multiline_allowed });
parse_fetchable_uri("a-> b", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(e);
TEST_CHECK_EQUAL(stringify(e), "a->\nb\n");
@@ -347,7 +347,7 @@ namespace test_cases
void run()
{
- StringifyFormatter ff;
+ UnformattedPrettyPrinter ff;
TestEnvironment env;
const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
@@ -356,7 +356,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ SpecTreePrettyPrinter d(ff, { });
TEST_CHECK_THROWS(parse_depend("!foo? ( one/one",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_depend("!foo? ( one/one ) )",
@@ -380,7 +380,7 @@ namespace test_cases
void run()
{
- StringifyFormatter ff;
+ UnformattedPrettyPrinter ff;
TestEnvironment env;
const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
@@ -389,7 +389,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ SpecTreePrettyPrinter d(ff, { });
TEST_CHECK_THROWS(parse_depend("||",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_depend("|| ",
@@ -435,7 +435,7 @@ namespace test_cases
void run()
{
- StringifyFormatter ff;
+ UnformattedPrettyPrinter ff;
TestEnvironment env;
const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
@@ -444,7 +444,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ SpecTreePrettyPrinter d(ff, { });
parse_depend("build: one/one",
&env, id, *EAPIData::get_instance()->eapi_from_string("exheres-0"))->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "build: one/one");
@@ -459,7 +459,7 @@ namespace test_cases
void run()
{
- StringifyFormatter ff;
+ UnformattedPrettyPrinter ff;
TestEnvironment env;
const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
@@ -468,7 +468,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ SpecTreePrettyPrinter d(ff, { });
parse_fetchable_uri("http://foo/bar manual: two",
&env, id, *EAPIData::get_instance()->eapi_from_string("exheres-0"))->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "http://foo/bar manual: two");
@@ -491,13 +491,13 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- StringifyFormatter ff;
- DepSpecPrettyPrinter d(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ UnformattedPrettyPrinter ff;
+ SpecTreePrettyPrinter d(ff, { });
parse_depend("cat/first [[ foo = bar bar = baz ]] cat/second cat/third [[ moo = oink ]]",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "cat/first [[ bar = [ baz ] foo = [ bar ] ]] cat/second cat/third [[ moo = [ oink ] ]]");
- DepSpecPrettyPrinter e(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ SpecTreePrettyPrinter e(ff, { });
parse_depend("bar? ( foo? ( cat/first [[ for = first ]] ) [[ for = foo ]] baz? ( ) [[ for = baz ]] ) [[ for = bar ]]",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(e);
TEST_CHECK_EQUAL(stringify(e), "bar? ( foo? ( cat/first [[ for = [ first ] ]] ) "
diff --git a/paludis/repositories/e/dep_spec_pretty_printer.cc b/paludis/repositories/e/dep_spec_pretty_printer.cc
deleted file mode 100644
index 6d64f0c83..000000000
--- a/paludis/repositories/e/dep_spec_pretty_printer.cc
+++ /dev/null
@@ -1,603 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
-#include <paludis/util/save.hh>
-#include <paludis/util/simple_visitor_cast.hh>
-#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/stringify.hh>
-#include <paludis/util/set.hh>
-#include <paludis/util/options.hh>
-#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/accept_visitor.hh>
-#include <paludis/environment.hh>
-#include <paludis/selection.hh>
-#include <paludis/generator.hh>
-#include <paludis/filter.hh>
-#include <paludis/filtered_generator.hh>
-#include <paludis/action-fwd.hh>
-#include <paludis/dep_spec.hh>
-#include <paludis/formatter.hh>
-#include <paludis/dep_spec_annotations.hh>
-#include <paludis/metadata_key.hh>
-#include <algorithm>
-#include <sstream>
-
-/** \file
- * Imp of dep_spec_pretty_printer.hh.
- *
- * \ingroup grpdepspecprettyprinter
- */
-
-using namespace paludis;
-using namespace paludis::erepository;
-
-namespace paludis
-{
- template<>
- struct Imp<DepSpecPrettyPrinter>
- {
- std::stringstream s;
- const Environment * const env;
- const std::shared_ptr<const PackageID> id;
- GenericSpecTree::ItemFormatter formatter;
- unsigned indent;
- bool extra_label_indent;
- bool use_newlines;
- bool outer_block;
- bool all_needs_parens;
- bool need_space;
- bool check_conditions;
-
- Imp(
- const Environment * const e,
- const std::shared_ptr<const PackageID> & i,
- const GenericSpecTree::ItemFormatter & f,
- unsigned in,
- bool b,
- bool c) :
- env(e),
- id(i),
- formatter(f),
- indent(in),
- extra_label_indent(false),
- use_newlines(b),
- outer_block(true),
- all_needs_parens(false),
- need_space(false),
- check_conditions(c)
- {
- }
- };
-}
-
-DepSpecPrettyPrinter::DepSpecPrettyPrinter(
- const Environment * const e,
- const std::shared_ptr<const PackageID> & id,
- const GenericSpecTree::ItemFormatter & f,
- unsigned i,
- bool b,
- bool c) :
- Pimp<DepSpecPrettyPrinter>(e, id, f, i, b, c)
-{
-}
-
-DepSpecPrettyPrinter::~DepSpecPrettyPrinter()
-{
-}
-
-std::ostream &
-paludis::erepository::operator<< (std::ostream & s, const DepSpecPrettyPrinter & p)
-{
- s << p._imp->s.str();
- return s;
-}
-
-namespace
-{
- struct IsLabelVisitor
- {
- bool result;
-
- IsLabelVisitor() :
- result(false)
- {
- }
-
- void visit(const GenericSpecTree::NodeType<PlainTextDepSpec>::Type &)
- {
- }
-
- void visit(const GenericSpecTree::NodeType<SimpleURIDepSpec>::Type &)
- {
- }
-
- void visit(const GenericSpecTree::NodeType<FetchableURIDepSpec>::Type &)
- {
- }
-
- void visit(const GenericSpecTree::NodeType<LicenseDepSpec>::Type &)
- {
- }
-
- void visit(const GenericSpecTree::NodeType<PackageDepSpec>::Type &)
- {
- }
-
- void visit(const GenericSpecTree::NodeType<BlockDepSpec>::Type &)
- {
- }
-
- void visit(const GenericSpecTree::NodeType<PlainTextLabelDepSpec>::Type &)
- {
- result = true;
- }
-
- void visit(const GenericSpecTree::NodeType<URILabelsDepSpec>::Type &)
- {
- result = true;
- }
-
- void visit(const GenericSpecTree::NodeType<DependenciesLabelsDepSpec>::Type &)
- {
- result = true;
- }
-
- void visit(const GenericSpecTree::NodeType<NamedSetDepSpec>::Type &)
- {
- }
-
- void visit(const GenericSpecTree::NodeType<AllDepSpec>::Type &)
- {
- }
-
- void visit(const GenericSpecTree::NodeType<ExactlyOneDepSpec>::Type &)
- {
- }
-
- void visit(const GenericSpecTree::NodeType<AnyDepSpec>::Type &)
- {
- }
-
- void visit(const GenericSpecTree::NodeType<ConditionalDepSpec>::Type &)
- {
- }
- };
-
- bool is_label(const GenericSpecTree::BasicNode & i)
- {
- IsLabelVisitor v;
- i.accept(v);
- return v.result;
- }
-}
-
-void
-DepSpecPrettyPrinter::visit(const GenericSpecTree::NodeType<AllDepSpec>::Type & node)
-{
- bool need_parens(_imp->all_needs_parens || node.spec()->maybe_annotations() ||
- (! _imp->outer_block && indirect_iterator(node.end()) != std::find_if(indirect_iterator(node.begin()),
- indirect_iterator(node.end()),
- is_label)));
- Save<bool> old_outer(&_imp->outer_block, false);
- Save<bool> old_needs_parens(&_imp->all_needs_parens, false);
-
- if (need_parens)
- {
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
- _imp->s << "(";
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
- }
-
- {
- Save<unsigned> old_indent(&_imp->indent, need_parens ? _imp->indent +1 : _imp->indent);
- Save<bool> extra_label_indent(&_imp->extra_label_indent, need_parens ? false : _imp->extra_label_indent);
- std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(*this));
- }
-
- if (need_parens)
- {
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
- _imp->s << ")";
-
- do_annotations(*node.spec());
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
- }
-}
-
-void
-DepSpecPrettyPrinter::visit(const GenericSpecTree::NodeType<AnyDepSpec>::Type & node)
-{
- Save<bool> old_outer(&_imp->outer_block, false);
- Save<bool> old_needs_parens(&_imp->all_needs_parens, true);
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
- _imp->s << "|| (";
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
-
- {
- Save<unsigned> old_indent(&_imp->indent, _imp->indent + 1);
- Save<bool> extra_label_indent(&_imp->extra_label_indent, false);
- std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(*this));
- }
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
- _imp->s << ")";
-
- do_annotations(*node.spec());
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
-}
-
-void
-DepSpecPrettyPrinter::visit(const GenericSpecTree::NodeType<ExactlyOneDepSpec>::Type & node)
-{
- Save<bool> old_outer(&_imp->outer_block, false);
- Save<bool> old_needs_parens(&_imp->all_needs_parens, true);
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
- _imp->s << "^^ (";
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
-
- {
- Save<unsigned> old_indent(&_imp->indent, _imp->indent + 1);
- Save<bool> extra_label_indent(&_imp->extra_label_indent, false);
- std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(*this));
- }
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
- _imp->s << ")";
-
- do_annotations(*node.spec());
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
-}
-
-void
-DepSpecPrettyPrinter::visit(const GenericSpecTree::NodeType<ConditionalDepSpec>::Type & node)
-{
- Save<bool> old_outer(&_imp->outer_block, false);
- Save<bool> old_needs_parens(&_imp->all_needs_parens, false);
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
-
- if (! _imp->check_conditions)
- _imp->s << _imp->formatter.format(*node.spec(), format::Plain()) << " (";
- else if (node.spec()->condition_met(_imp->env, _imp->id))
- _imp->s << _imp->formatter.format(*node.spec(), format::Enabled()) << " (";
- else
- _imp->s << _imp->formatter.format(*node.spec(), format::Disabled()) << " (";
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
-
- {
- Save<unsigned> old_indent(&_imp->indent, _imp->indent + 1);
- Save<bool> extra_label_indent(&_imp->extra_label_indent, false);
- std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(*this));
- }
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
- _imp->s << ")";
-
- do_annotations(*node.spec());
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
-}
-
-void
-DepSpecPrettyPrinter::visit(const GenericSpecTree::NodeType<PackageDepSpec>::Type & node)
-{
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
-
- if (_imp->env && _imp->check_conditions)
- {
- if (! (*_imp->env)[selection::SomeArbitraryVersion(generator::Matches(*node.spec(), { }) |
- filter::InstalledAtRoot(_imp->env->preferred_root_key()->value()))]->empty())
- _imp->s << _imp->formatter.format(*node.spec(), format::Installed());
- else if (! (*_imp->env)[selection::SomeArbitraryVersion(generator::Matches(*node.spec(), { }) |
- filter::SupportsAction<InstallAction>() | filter::NotMasked())]->empty())
- _imp->s << _imp->formatter.format(*node.spec(), format::Installable());
- else
- _imp->s << _imp->formatter.format(*node.spec(), format::Plain());
- }
- else
- _imp->s << _imp->formatter.format(*node.spec(), format::Plain());
-
- do_annotations(*node.spec());
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
-}
-
-void
-DepSpecPrettyPrinter::visit(const GenericSpecTree::NodeType<PlainTextDepSpec>::Type & node)
-{
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
-
- _imp->s << _imp->formatter.format(*node.spec(), format::Plain());
-
- do_annotations(*node.spec());
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
-}
-
-void
-DepSpecPrettyPrinter::visit(const GenericSpecTree::NodeType<NamedSetDepSpec>::Type & node)
-{
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
-
- _imp->s << _imp->formatter.format(*node.spec(), format::Plain());
-
- do_annotations(*node.spec());
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
-}
-
-void
-DepSpecPrettyPrinter::visit(const GenericSpecTree::NodeType<LicenseDepSpec>::Type & node)
-{
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
-
- if (_imp->env && _imp->id && _imp->check_conditions)
- {
- if (_imp->env->accept_license(node.spec()->text(), _imp->id))
- _imp->s << _imp->formatter.format(*node.spec(), format::Accepted());
- else
- _imp->s << _imp->formatter.format(*node.spec(), format::Unaccepted());
- }
- else
- _imp->s << _imp->formatter.format(*node.spec(), format::Plain());
-
- do_annotations(*node.spec());
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
-}
-
-void
-DepSpecPrettyPrinter::visit(const GenericSpecTree::NodeType<FetchableURIDepSpec>::Type & node)
-{
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
-
- _imp->s << _imp->formatter.format(*node.spec(), format::Plain());
-
- do_annotations(*node.spec());
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
-}
-
-void
-DepSpecPrettyPrinter::visit(const GenericSpecTree::NodeType<SimpleURIDepSpec>::Type & node)
-{
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
-
- _imp->s << _imp->formatter.format(*node.spec(), format::Plain());
-
- do_annotations(*node.spec());
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
-}
-
-void
-DepSpecPrettyPrinter::visit(const GenericSpecTree::NodeType<BlockDepSpec>::Type & node)
-{
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
-
- _imp->s << _imp->formatter.format(*node.spec(), format::Plain());
-
- do_annotations(*node.spec());
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
-}
-
-void
-DepSpecPrettyPrinter::visit(const GenericSpecTree::NodeType<URILabelsDepSpec>::Type & node)
-{
- if (_imp->extra_label_indent)
- {
- _imp->extra_label_indent = false;
- _imp->indent -= 1;
- }
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
-
- _imp->s << _imp->formatter.format(*node.spec(), format::Plain());
-
- do_annotations(*node.spec());
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
-
- if (! _imp->extra_label_indent)
- {
- _imp->extra_label_indent = true;
- _imp->indent += 1;
- }
-}
-
-void
-DepSpecPrettyPrinter::visit(const GenericSpecTree::NodeType<PlainTextLabelDepSpec>::Type & node)
-{
- if (_imp->extra_label_indent)
- {
- _imp->extra_label_indent = false;
- _imp->indent -= 1;
- }
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
-
- _imp->s << _imp->formatter.format(*node.spec(), format::Plain());
-
- do_annotations(*node.spec());
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
-
- if (! _imp->extra_label_indent)
- {
- _imp->extra_label_indent = true;
- _imp->indent += 1;
- }
-}
-
-void
-DepSpecPrettyPrinter::visit(const GenericSpecTree::NodeType<DependenciesLabelsDepSpec>::Type & node)
-{
- if (_imp->extra_label_indent)
- {
- _imp->extra_label_indent = false;
- _imp->indent -= 1;
- }
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.indent(_imp->indent);
- else if (_imp->need_space)
- _imp->s << " ";
-
- _imp->s << _imp->formatter.format(*node.spec(), format::Plain());
-
- do_annotations(*node.spec());
-
- if (_imp->use_newlines)
- _imp->s << _imp->formatter.newline();
- else
- _imp->need_space = true;
-
- if (!_imp->extra_label_indent)
- {
- _imp->extra_label_indent = true;
- _imp->indent += 1;
- }
-}
-
-void
-DepSpecPrettyPrinter::do_annotations(const DepSpec & p)
-{
- if (p.maybe_annotations() && (p.maybe_annotations()->begin() != p.maybe_annotations()->end()))
- {
- _imp->s << " [[ ";
-
- for (auto m(p.maybe_annotations()->begin()), m_end(p.maybe_annotations()->end()) ;
- m != m_end ; ++m)
- {
- _imp->s << m->key() << " = [" << (m->value().empty() ? " " : " " + m->value() + " ") << "] ";
- }
- _imp->s << "]]";
- }
-}
-
diff --git a/paludis/repositories/e/dep_spec_pretty_printer.hh b/paludis/repositories/e/dep_spec_pretty_printer.hh
deleted file mode 100644
index 59d85c87d..000000000
--- a/paludis/repositories/e/dep_spec_pretty_printer.hh
+++ /dev/null
@@ -1,121 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_DEP_ATOM_PRETTY_PRINTER_HH
-#define PALUDIS_GUARD_PALUDIS_DEP_ATOM_PRETTY_PRINTER_HH 1
-
-#include <iosfwd>
-#include <paludis/dep_spec.hh>
-#include <paludis/spec_tree.hh>
-#include <paludis/metadata_key-fwd.hh>
-#include <paludis/environment-fwd.hh>
-#include <paludis/package_id-fwd.hh>
-
-/** \file
- * Declarations for the paludis::erepository::DepSpecPrettyPrinter class.
- *
- * \ingroup grperepository
- */
-
-namespace paludis
-{
- namespace erepository
- {
- /**
- * Pretty print dependency specs.
- *
- * \ingroup grperepository
- */
- class PALUDIS_VISIBLE DepSpecPrettyPrinter :
- private Pimp<DepSpecPrettyPrinter>
- {
- friend std::ostream & operator<< (std::ostream &, const DepSpecPrettyPrinter &);
-
- private:
- void do_annotations(const DepSpec &);
-
- public:
- ///\name Basic operations
- ///\{
-
- /**
- * Constructor.
- *
- * \param env An optional environment, to use for formatting PackageDepSpec items
- * as format::Installed() etc. May be null, in which case format::Plain() is
- * always used.
- *
- * \param id The ID to use for determining use flag formatting. May be null, in
- * which case format::Plain() is used.
- *
- * \param formatter The formatter to use. If no fancy formatting is required, use
- * StringifyFormatter.
- *
- * \param initial_indent Amount of indenting to use. Should probably be 0 if
- * use_newlines is false.
- *
- * \param use_newlines Whether to format over multiple lines.
- *
- * \param check_conditions Whether to check conditions and format as appropriate.
- * When writing cache files, formatting isn't useful and we don't have the choices
- * key ready yet.
- */
- DepSpecPrettyPrinter(
- const Environment * const env,
- const std::shared_ptr<const PackageID> & id,
- const GenericSpecTree::ItemFormatter & formatter,
- unsigned initial_indent,
- bool use_newlines,
- bool check_conditions);
-
- ~DepSpecPrettyPrinter();
-
- ///\}
-
- /// \name Visit functions
- ///{
-
- void visit(const GenericSpecTree::NodeType<AllDepSpec>::Type & node);
- void visit(const GenericSpecTree::NodeType<AnyDepSpec>::Type & node);
- void visit(const GenericSpecTree::NodeType<ExactlyOneDepSpec>::Type & node);
- void visit(const GenericSpecTree::NodeType<ConditionalDepSpec>::Type & node);
- void visit(const GenericSpecTree::NodeType<PackageDepSpec>::Type & node);
- void visit(const GenericSpecTree::NodeType<BlockDepSpec>::Type & node);
- void visit(const GenericSpecTree::NodeType<DependenciesLabelsDepSpec>::Type & node);
- void visit(const GenericSpecTree::NodeType<NamedSetDepSpec>::Type & node);
- void visit(const GenericSpecTree::NodeType<SimpleURIDepSpec>::Type & node);
- void visit(const GenericSpecTree::NodeType<FetchableURIDepSpec>::Type & node);
- void visit(const GenericSpecTree::NodeType<URILabelsDepSpec>::Type & node);
- void visit(const GenericSpecTree::NodeType<PlainTextDepSpec>::Type & node);
- void visit(const GenericSpecTree::NodeType<PlainTextLabelDepSpec>::Type & node);
- void visit(const GenericSpecTree::NodeType<LicenseDepSpec>::Type & node);
-
- ///}
- };
-
- /**
- * Output a DepSpecPrettyPrinter to an ostream.
- *
- * \ingroup grperepository
- */
- std::ostream & operator<< (std::ostream & s, const DepSpecPrettyPrinter & p) PALUDIS_VISIBLE;
- }
-}
-
-#endif
diff --git a/paludis/repositories/e/depend_rdepend_TEST.cc b/paludis/repositories/e/depend_rdepend_TEST.cc
index c8d885356..849c2a0b4 100644
--- a/paludis/repositories/e/depend_rdepend_TEST.cc
+++ b/paludis/repositories/e/depend_rdepend_TEST.cc
@@ -33,7 +33,6 @@
#include <paludis/generator.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/filter.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/metadata_key.hh>
#include <paludis/unformatted_pretty_printer.hh>
#include <test/test_framework.hh>
diff --git a/paludis/repositories/e/e_choices_key.cc b/paludis/repositories/e/e_choices_key.cc
index a9cd8b858..023a79a35 100644
--- a/paludis/repositories/e/e_choices_key.cc
+++ b/paludis/repositories/e/e_choices_key.cc
@@ -21,7 +21,6 @@
#include <paludis/repositories/e/e_key.hh>
#include <paludis/repositories/e/ebuild_id.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/e/profile.hh>
#include <paludis/repositories/e/e_repository.hh>
#include <paludis/repositories/e/myoption.hh>
@@ -42,7 +41,6 @@
#include <paludis/util/accept_visitor.hh>
#include <paludis/environment.hh>
-#include <paludis/stringify_formatter-impl.hh>
#include <paludis/choice.hh>
#include <paludis/elike_choices.hh>
#include <paludis/dep_spec_annotations.hh>
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 3a7bd52ce..8013de365 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -21,7 +21,6 @@
#include <paludis/repositories/e/ebuild_id.hh>
#include <paludis/repositories/e/dep_parser.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/e/vdb_contents_tokeniser.hh>
#include <paludis/repositories/e/e_repository.hh>
#include <paludis/repositories/e/myoption.hh>
@@ -49,7 +48,6 @@
#include <paludis/contents.hh>
#include <paludis/repository.hh>
#include <paludis/environment.hh>
-#include <paludis/stringify_formatter-impl.hh>
#include <paludis/dep_spec_flattener.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/call_pretty_printer.hh>
@@ -179,24 +177,6 @@ EDependenciesKey::pretty_print_value(
return stringify(p);
}
-std::string
-EDependenciesKey::pretty_print(const DependencySpecTree::ItemFormatter & f) const
-{
- StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true, true);
- value()->top()->accept(p);
- return stringify(p);
-}
-
-std::string
-EDependenciesKey::pretty_print_flat(const DependencySpecTree::ItemFormatter & f) const
-{
- StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false, true);
- value()->top()->accept(p);
- return stringify(p);
-}
-
const std::string
EDependenciesKey::raw_name() const
{
@@ -276,24 +256,6 @@ ELicenseKey::pretty_print_value(
return stringify(p);
}
-std::string
-ELicenseKey::pretty_print(const LicenseSpecTree::ItemFormatter & f) const
-{
- StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true, true);
- value()->top()->accept(p);
- return stringify(p);
-}
-
-std::string
-ELicenseKey::pretty_print_flat(const LicenseSpecTree::ItemFormatter & f) const
-{
- StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false, true);
- value()->top()->accept(p);
- return stringify(p);
-}
-
const std::string
ELicenseKey::raw_name() const
{
@@ -374,24 +336,6 @@ EFetchableURIKey::pretty_print_value(
return stringify(p);
}
-std::string
-EFetchableURIKey::pretty_print(const FetchableURISpecTree::ItemFormatter & f) const
-{
- StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true, true);
- value()->top()->accept(p);
- return stringify(p);
-}
-
-std::string
-EFetchableURIKey::pretty_print_flat(const FetchableURISpecTree::ItemFormatter & f) const
-{
- StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false, true);
- value()->top()->accept(p);
- return stringify(p);
-}
-
const std::shared_ptr<const URILabel>
EFetchableURIKey::initial_label() const
{
@@ -509,24 +453,6 @@ ESimpleURIKey::pretty_print_value(
return stringify(p);
}
-std::string
-ESimpleURIKey::pretty_print(const SimpleURISpecTree::ItemFormatter & f) const
-{
- StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true, true);
- value()->top()->accept(p);
- return stringify(p);
-}
-
-std::string
-ESimpleURIKey::pretty_print_flat(const SimpleURISpecTree::ItemFormatter & f) const
-{
- StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false, true);
- value()->top()->accept(p);
- return stringify(p);
-}
-
const std::string
ESimpleURIKey::raw_name() const
{
@@ -606,24 +532,6 @@ EPlainTextSpecKey::pretty_print_value(
return stringify(p);
}
-std::string
-EPlainTextSpecKey::pretty_print(const PlainTextSpecTree::ItemFormatter & f) const
-{
- StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true, true);
- value()->top()->accept(p);
- return stringify(p);
-}
-
-std::string
-EPlainTextSpecKey::pretty_print_flat(const PlainTextSpecTree::ItemFormatter & f) const
-{
- StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false, true);
- value()->top()->accept(p);
- return stringify(p);
-}
-
const std::string
EPlainTextSpecKey::raw_name() const
{
@@ -704,24 +612,6 @@ EMyOptionsKey::pretty_print_value(
return stringify(p);
}
-std::string
-EMyOptionsKey::pretty_print(const PlainTextSpecTree::ItemFormatter & f) const
-{
- StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true, true);
- value()->top()->accept(p);
- return stringify(p);
-}
-
-std::string
-EMyOptionsKey::pretty_print_flat(const PlainTextSpecTree::ItemFormatter & f) const
-{
- StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false, true);
- value()->top()->accept(p);
- return stringify(p);
-}
-
const std::string
EMyOptionsKey::raw_name() const
{
@@ -802,24 +692,6 @@ ERequiredUseKey::pretty_print_value(
return stringify(p);
}
-std::string
-ERequiredUseKey::pretty_print(const RequiredUseSpecTree::ItemFormatter & f) const
-{
- StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true, true);
- value()->top()->accept(p);
- return stringify(p);
-}
-
-std::string
-ERequiredUseKey::pretty_print_flat(const RequiredUseSpecTree::ItemFormatter & f) const
-{
- StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false, true);
- value()->top()->accept(p);
- return stringify(p);
-}
-
const std::string
ERequiredUseKey::raw_name() const
{
@@ -899,24 +771,6 @@ EProvideKey::pretty_print_value(
return stringify(p);
}
-std::string
-EProvideKey::pretty_print(const ProvideSpecTree::ItemFormatter & f) const
-{
- StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true, true);
- value()->top()->accept(p);
- return stringify(p);
-}
-
-std::string
-EProvideKey::pretty_print_flat(const ProvideSpecTree::ItemFormatter & f) const
-{
- StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false, true);
- value()->top()->accept(p);
- return stringify(p);
-}
-
const std::string
EProvideKey::raw_name() const
{
@@ -992,27 +846,6 @@ EKeywordsKey::pretty_print_value(const PrettyPrinter & p, const PrettyPrintOptio
return join(value()->begin(), value()->end(), " ", CallPrettyPrinter(p));
}
-std::string
-EKeywordsKey::pretty_print_flat(const Formatter<KeywordName> & f) const
-{
- std::string result;
- for (KeywordNameSet::ConstIterator i(value()->begin()), i_end(value()->end()) ;
- i != i_end ; ++i)
- {
- if (! result.empty())
- result.append(" ");
-
- std::shared_ptr<KeywordNameSet> k(std::make_shared<KeywordNameSet>());
- k->insert(*i);
- if (_imp->env->accept_keywords(k, _imp->id))
- result.append(f.format(*i, format::Accepted()));
- else
- result.append(f.format(*i, format::Unaccepted()));
- }
-
- return result;
-}
-
const std::string
EKeywordsKey::raw_name() const
{
@@ -1099,21 +932,6 @@ EStringSetKey::type() const
return _imp->type;
}
-namespace
-{
- std::string format_string(const std::string & i, const Formatter<std::string> & f)
- {
- return f.format(i, format::Plain());
- }
-}
-
-std::string
-EStringSetKey::pretty_print_flat(const Formatter<std::string> & f) const
-{
- using namespace std::placeholders;
- return join(value()->begin(), value()->end(), " ", std::bind(&format_string, _1, f));
-}
-
const std::string
EStringSetKey::pretty_print_value(
const PrettyPrinter & p, const PrettyPrintOptions &) const
diff --git a/paludis/repositories/e/e_key.hh b/paludis/repositories/e/e_key.hh
index 6589da8ff..4b80c206c 100644
--- a/paludis/repositories/e/e_key.hh
+++ b/paludis/repositories/e/e_key.hh
@@ -73,12 +73,6 @@ namespace paludis
virtual const std::shared_ptr<const DependencySpecTree> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::string pretty_print(const DependencySpecTree::ItemFormatter &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::string pretty_print_flat(const DependencySpecTree::ItemFormatter &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual const std::shared_ptr<const DependenciesLabelSequence> initial_labels() const
PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -106,12 +100,6 @@ namespace paludis
virtual const std::shared_ptr<const FetchableURISpecTree> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::string pretty_print(const FetchableURISpecTree::ItemFormatter &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::string pretty_print_flat(const FetchableURISpecTree::ItemFormatter &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual const std::shared_ptr<const URILabel> initial_label() const
PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -137,12 +125,6 @@ namespace paludis
virtual const std::shared_ptr<const SimpleURISpecTree> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::string pretty_print(const SimpleURISpecTree::ItemFormatter &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::string pretty_print_flat(const SimpleURISpecTree::ItemFormatter &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -166,12 +148,6 @@ namespace paludis
virtual const std::shared_ptr<const PlainTextSpecTree> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::string pretty_print(const PlainTextSpecTree::ItemFormatter &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::string pretty_print_flat(const PlainTextSpecTree::ItemFormatter &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -194,12 +170,6 @@ namespace paludis
virtual const std::shared_ptr<const PlainTextSpecTree> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::string pretty_print(const PlainTextSpecTree::ItemFormatter &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::string pretty_print_flat(const PlainTextSpecTree::ItemFormatter &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -222,12 +192,6 @@ namespace paludis
virtual const std::shared_ptr<const RequiredUseSpecTree> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::string pretty_print(const RequiredUseSpecTree::ItemFormatter &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::string pretty_print_flat(const RequiredUseSpecTree::ItemFormatter &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -250,12 +214,6 @@ namespace paludis
virtual const std::shared_ptr<const ProvideSpecTree> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::string pretty_print(const ProvideSpecTree::ItemFormatter &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::string pretty_print_flat(const ProvideSpecTree::ItemFormatter &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -280,12 +238,6 @@ namespace paludis
virtual const std::shared_ptr<const LicenseSpecTree> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::string pretty_print(const LicenseSpecTree::ItemFormatter &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::string pretty_print_flat(const LicenseSpecTree::ItemFormatter &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -309,9 +261,6 @@ namespace paludis
const std::shared_ptr<const KeywordNameSet> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::string pretty_print_flat(const Formatter<KeywordName> &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -333,9 +282,6 @@ namespace paludis
const std::shared_ptr<const Set<std::string> > value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::string pretty_print_flat(const Formatter<std::string> &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index d3b4a3190..705970bd4 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -22,7 +22,7 @@
#include <paludis/repositories/e/e_repository_id.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
+#include <paludis/repositories/e/spec_tree_pretty_printer.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/environments/test/test_environment.hh>
@@ -38,7 +38,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
@@ -46,6 +45,7 @@
#include <paludis/selection.hh>
#include <paludis/repository_factory.hh>
#include <paludis/choice.hh>
+#include <paludis/unformatted_pretty_printer.hh>
#include <paludis/util/indirect_iterator-impl.hh>
@@ -504,12 +504,12 @@ namespace test_cases
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id1->find_metadata("EAPI"))->value(), "0");
TEST_CHECK(bool(id1->short_description_key()));
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Description");
- StringifyFormatter ff;
- erepository::DepSpecPrettyPrinter pd(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ UnformattedPrettyPrinter ff;
+ erepository::SpecTreePrettyPrinter pd(ff, { });
TEST_CHECK(bool(id1->build_dependencies_key()));
id1->build_dependencies_key()->value()->top()->accept(pd);
TEST_CHECK_STRINGIFY_EQUAL(pd, "foo/bar");
- erepository::DepSpecPrettyPrinter pr(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ erepository::SpecTreePrettyPrinter pr(ff, { });
TEST_CHECK(bool(id1->run_dependencies_key()));
id1->run_dependencies_key()->value()->top()->accept(pr);
TEST_CHECK_STRINGIFY_EQUAL(pr, "foo/bar");
@@ -521,11 +521,11 @@ namespace test_cases
TEST_CHECK(id2->end_metadata() != id2->find_metadata("EAPI"));
TEST_CHECK(bool(id2->short_description_key()));
TEST_CHECK_EQUAL(id2->short_description_key()->value(), "dquote \" squote ' backslash \\ dollar $");
- erepository::DepSpecPrettyPrinter pd2(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ erepository::SpecTreePrettyPrinter pd2(ff, { });
TEST_CHECK(bool(id2->build_dependencies_key()));
id2->build_dependencies_key()->value()->top()->accept(pd2);
TEST_CHECK_STRINGIFY_EQUAL(pd2, "foo/bar bar/baz");
- erepository::DepSpecPrettyPrinter pr2(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ erepository::SpecTreePrettyPrinter pr2(ff, { });
TEST_CHECK(bool(id2->run_dependencies_key()));
id2->run_dependencies_key()->value()->top()->accept(pr2);
TEST_CHECK_STRINGIFY_EQUAL(pr2, "foo/bar");
diff --git a/paludis/repositories/e/e_repository_TEST_0.cc b/paludis/repositories/e/e_repository_TEST_0.cc
index 106d475e8..bb18821aa 100644
--- a/paludis/repositories/e/e_repository_TEST_0.cc
+++ b/paludis/repositories/e/e_repository_TEST_0.cc
@@ -22,7 +22,6 @@
#include <paludis/repositories/e/e_repository_id.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/environments/test/test_environment.hh>
@@ -36,7 +35,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
diff --git a/paludis/repositories/e/e_repository_TEST_1.cc b/paludis/repositories/e/e_repository_TEST_1.cc
index d30c80bd1..c786c2024 100644
--- a/paludis/repositories/e/e_repository_TEST_1.cc
+++ b/paludis/repositories/e/e_repository_TEST_1.cc
@@ -22,7 +22,6 @@
#include <paludis/repositories/e/e_repository_id.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/environments/test/test_environment.hh>
@@ -36,7 +35,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
diff --git a/paludis/repositories/e/e_repository_TEST_2.cc b/paludis/repositories/e/e_repository_TEST_2.cc
index 88d5201a7..768ff8072 100644
--- a/paludis/repositories/e/e_repository_TEST_2.cc
+++ b/paludis/repositories/e/e_repository_TEST_2.cc
@@ -22,7 +22,6 @@
#include <paludis/repositories/e/e_repository_id.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/environments/test/test_environment.hh>
@@ -36,7 +35,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
diff --git a/paludis/repositories/e/e_repository_TEST_3.cc b/paludis/repositories/e/e_repository_TEST_3.cc
index 6a2fb3dd0..46942563e 100644
--- a/paludis/repositories/e/e_repository_TEST_3.cc
+++ b/paludis/repositories/e/e_repository_TEST_3.cc
@@ -22,7 +22,6 @@
#include <paludis/repositories/e/e_repository_id.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/environments/test/test_environment.hh>
@@ -36,7 +35,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
diff --git a/paludis/repositories/e/e_repository_TEST_4.cc b/paludis/repositories/e/e_repository_TEST_4.cc
index ea672a489..b720681a3 100644
--- a/paludis/repositories/e/e_repository_TEST_4.cc
+++ b/paludis/repositories/e/e_repository_TEST_4.cc
@@ -22,7 +22,7 @@
#include <paludis/repositories/e/e_repository_id.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
+#include <paludis/repositories/e/spec_tree_pretty_printer.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/environments/test/test_environment.hh>
@@ -36,7 +36,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
diff --git a/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
index 1ca688e33..b07f79ef9 100644
--- a/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
+++ b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
@@ -22,7 +22,7 @@
#include <paludis/repositories/e/e_repository_id.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
+#include <paludis/repositories/e/spec_tree_pretty_printer.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/environments/test/test_environment.hh>
@@ -36,7 +36,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
@@ -44,6 +43,7 @@
#include <paludis/selection.hh>
#include <paludis/repository_factory.hh>
#include <paludis/choice.hh>
+#include <paludis/unformatted_pretty_printer.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <functional>
@@ -108,19 +108,19 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("category/package",
&env, { })), { }))]->last());
- StringifyFormatter ff;
+ UnformattedPrettyPrinter ff;
- erepository::DepSpecPrettyPrinter pd(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ erepository::SpecTreePrettyPrinter pd(ff, { });
TEST_CHECK(bool(id->build_dependencies_key()));
id->build_dependencies_key()->value()->top()->accept(pd);
TEST_CHECK_STRINGIFY_EQUAL(pd, "( cat/pkg1 build: cat/pkg2 build+run: cat/pkg3 suggestion: post: )");
- erepository::DepSpecPrettyPrinter pr(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ erepository::SpecTreePrettyPrinter pr(ff, { });
TEST_CHECK(bool(id->run_dependencies_key()));
id->run_dependencies_key()->value()->top()->accept(pr);
TEST_CHECK_STRINGIFY_EQUAL(pr, "( cat/pkg1 build: build+run: cat/pkg3 suggestion: post: )");
- erepository::DepSpecPrettyPrinter pp(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ erepository::SpecTreePrettyPrinter pp(ff, { });
TEST_CHECK(bool(id->post_dependencies_key()));
id->post_dependencies_key()->value()->top()->accept(pp);
TEST_CHECK_STRINGIFY_EQUAL(pp, "( build: build+run: suggestion: cat/pkg4 post: cat/pkg5 )");
diff --git a/paludis/repositories/e/e_repository_TEST_ever.cc b/paludis/repositories/e/e_repository_TEST_ever.cc
index ed6574899..1d0f418ee 100644
--- a/paludis/repositories/e/e_repository_TEST_ever.cc
+++ b/paludis/repositories/e/e_repository_TEST_ever.cc
@@ -22,7 +22,6 @@
#include <paludis/repositories/e/e_repository_id.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/environments/test/test_environment.hh>
@@ -36,7 +35,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
diff --git a/paludis/repositories/e/e_repository_TEST_exheres_0.cc b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
index 449e318e8..8025b46ed 100644
--- a/paludis/repositories/e/e_repository_TEST_exheres_0.cc
+++ b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
@@ -22,7 +22,6 @@
#include <paludis/repositories/e/e_repository_id.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/environments/test/test_environment.hh>
@@ -36,7 +35,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
diff --git a/paludis/repositories/e/e_repository_TEST_exlibs.cc b/paludis/repositories/e/e_repository_TEST_exlibs.cc
index dc889d0e4..10ad171cf 100644
--- a/paludis/repositories/e/e_repository_TEST_exlibs.cc
+++ b/paludis/repositories/e/e_repository_TEST_exlibs.cc
@@ -23,7 +23,6 @@
#include <paludis/repositories/e/e_repository_id.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/environments/test/test_environment.hh>
@@ -35,7 +34,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
diff --git a/paludis/repositories/e/e_repository_TEST_pbin.cc b/paludis/repositories/e/e_repository_TEST_pbin.cc
index 2831bc588..a940010cf 100644
--- a/paludis/repositories/e/e_repository_TEST_pbin.cc
+++ b/paludis/repositories/e/e_repository_TEST_pbin.cc
@@ -22,7 +22,6 @@
#include <paludis/repositories/e/e_repository_id.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/environments/test/test_environment.hh>
@@ -37,7 +36,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
diff --git a/paludis/repositories/e/e_repository_TEST_phases.cc b/paludis/repositories/e/e_repository_TEST_phases.cc
index 7e360361f..ef73cbc0b 100644
--- a/paludis/repositories/e/e_repository_TEST_phases.cc
+++ b/paludis/repositories/e/e_repository_TEST_phases.cc
@@ -22,7 +22,6 @@
#include <paludis/repositories/e/e_repository_id.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/environments/test/test_environment.hh>
@@ -36,7 +35,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
diff --git a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
index a69984c0f..afec5f7c6 100644
--- a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
+++ b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
@@ -22,7 +22,6 @@
#include <paludis/repositories/e/e_repository_id.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/environments/test/test_environment.hh>
@@ -36,7 +35,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
diff --git a/paludis/repositories/e/e_repository_sets_TEST.cc b/paludis/repositories/e/e_repository_sets_TEST.cc
index 31f3e6670..e1268331d 100644
--- a/paludis/repositories/e/e_repository_sets_TEST.cc
+++ b/paludis/repositories/e/e_repository_sets_TEST.cc
@@ -18,7 +18,7 @@
*/
#include <paludis/repositories/e/e_repository.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
+#include <paludis/repositories/e/spec_tree_pretty_printer.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/environments/test/test_environment.hh>
@@ -26,7 +26,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/set.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/stringify_formatter.hh>
+#include <paludis/unformatted_pretty_printer.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include "config.h"
@@ -103,8 +103,8 @@ namespace test_cases
std::shared_ptr<const SetSpecTree> set1(env.set(SetName("set1::test-repo-1")));
TEST_CHECK(bool(set1));
- StringifyFormatter ff;
- erepository::DepSpecPrettyPrinter pretty(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ UnformattedPrettyPrinter ff;
+ erepository::SpecTreePrettyPrinter pretty(ff, { });
set1->top()->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "cat-one/foo >=cat-two/bar-2");
}
@@ -133,8 +133,8 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const SetSpecTree> insecurity(env.set(SetName("insecurity::test-repo-1")));
- StringifyFormatter ff;
- erepository::DepSpecPrettyPrinter pretty(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ UnformattedPrettyPrinter ff;
+ erepository::SpecTreePrettyPrinter pretty(ff, { });
insecurity->top()->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "=cat-four/xyzzy-2.0.1::test-repo-1 =cat-four/xyzzy-2.0.2::test-repo-1 =cat-one/foo-1::test-repo-1 =cat-two/bar-1.5::test-repo-1 "
"=cat-two/bar-1.5.1::test-repo-1 =cat-three/baz-1.0::test-repo-1 "
@@ -177,8 +177,8 @@ namespace test_cases
env.package_database()->add_repository(0, installed);
std::shared_ptr<const SetSpecTree> security(env.set(SetName("security::test-repo-1")));
- StringifyFormatter ff;
- erepository::DepSpecPrettyPrinter pretty(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ UnformattedPrettyPrinter ff;
+ erepository::SpecTreePrettyPrinter pretty(ff, { });
security->top()->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "=cat-four/xyzzy-2.0.3::test-repo-1 =cat-two/bar-2.0::test-repo-1 =cat-three/baz-1.3::test-repo-1");
}
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index 30d9c8f8d..ab502a556 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -30,14 +30,14 @@
#include <paludis/util/timestamp.hh>
#include <paludis/util/fs_stat.hh>
#include <paludis/util/fs_error.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/e/dep_parser.hh>
#include <paludis/repositories/e/dependencies_rewriter.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/spec_tree_pretty_printer.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
+#include <paludis/unformatted_pretty_printer.hh>
#include <set>
#include <map>
#include <list>
@@ -676,8 +676,8 @@ namespace
template <typename T_>
std::string flatten(const T_ & d)
{
- StringifyFormatter ff;
- DepSpecPrettyPrinter p(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ UnformattedPrettyPrinter f;
+ SpecTreePrettyPrinter p(f, { });
d->top()->accept(p);
return stringify(p);
}
diff --git a/paludis/repositories/e/fix_locked_dependencies_TEST.cc b/paludis/repositories/e/fix_locked_dependencies_TEST.cc
index 74f37103b..ca6ffb9c8 100644
--- a/paludis/repositories/e/fix_locked_dependencies_TEST.cc
+++ b/paludis/repositories/e/fix_locked_dependencies_TEST.cc
@@ -20,14 +20,14 @@
#include <paludis/repositories/e/fix_locked_dependencies.hh>
#include <paludis/repositories/e/dep_parser.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
+#include <paludis/repositories/e/spec_tree_pretty_printer.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/package_database.hh>
+#include <paludis/unformatted_pretty_printer.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -67,10 +67,10 @@ namespace test_cases
"|| ( foo/bar ( bar/baz oink/squeak ) ) blah/blah", &env, id, *eapi)),
aa(fix_locked_dependencies(&env, *eapi, id, bb));
- StringifyFormatter ff;
- DepSpecPrettyPrinter
- a(0, std::shared_ptr<const PackageID>(), ff, 0, false, false),
- b(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ UnformattedPrettyPrinter ff;
+ SpecTreePrettyPrinter
+ a(ff, { }),
+ b(ff, { });
aa->top()->accept(a);
bb->top()->accept(b);
@@ -80,9 +80,9 @@ namespace test_cases
"foo/bar:= cat/installed:= >=cat/installed-1.2:= <=cat/installed-1.2:=", &env, id, *eapi)),
dd(fix_locked_dependencies(&env, *eapi, id, cc));
- DepSpecPrettyPrinter
- c(0, std::shared_ptr<const PackageID>(), ff, 0, false, false),
- d(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ SpecTreePrettyPrinter
+ c(ff, { }),
+ d(ff, { });
cc->top()->accept(c);
dd->top()->accept(d);
diff --git a/paludis/repositories/e/info_metadata_key.cc b/paludis/repositories/e/info_metadata_key.cc
index 11744495a..a14cfbd78 100644
--- a/paludis/repositories/e/info_metadata_key.cc
+++ b/paludis/repositories/e/info_metadata_key.cc
@@ -41,7 +41,6 @@
#include <paludis/dep_spec.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
-#include <paludis/formatter.hh>
#include <paludis/pretty_printer.hh>
#include <paludis/call_pretty_printer.hh>
@@ -211,21 +210,6 @@ InfoPkgsMetadataKey::need_keys_added() const
}
}
-namespace
-{
- std::string format_string(const std::string & i, const Formatter<std::string> & f)
- {
- return f.format(i, format::Plain());
- }
-}
-
-std::string
-InfoVarsMetadataKey::pretty_print_flat(const Formatter<std::string> & f) const
-{
- using namespace std::placeholders;
- return join(value()->begin(), value()->end(), " ", std::bind(&format_string, _1, f));
-}
-
const std::string
InfoVarsMetadataKey::pretty_print_value(
const PrettyPrinter & pretty_printer,
diff --git a/paludis/repositories/e/info_metadata_key.hh b/paludis/repositories/e/info_metadata_key.hh
index ea3dc9fe1..01e04e7a2 100644
--- a/paludis/repositories/e/info_metadata_key.hh
+++ b/paludis/repositories/e/info_metadata_key.hh
@@ -45,8 +45,6 @@ namespace paludis
const std::shared_ptr<const Set<std::string> > value() const;
- std::string pretty_print_flat(const Formatter<std::string> &) const;
-
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/pipe_command_handler.cc b/paludis/repositories/e/pipe_command_handler.cc
index d7e048fff..0e839ebec 100644
--- a/paludis/repositories/e/pipe_command_handler.cc
+++ b/paludis/repositories/e/pipe_command_handler.cc
@@ -22,7 +22,7 @@
#include <paludis/repositories/e/eapi.hh>
#include <paludis/repositories/e/fix_locked_dependencies.hh>
#include <paludis/repositories/e/dep_parser.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
+#include <paludis/repositories/e/spec_tree_pretty_printer.hh>
#include <paludis/util/log.hh>
#include <paludis/util/join.hh>
#include <paludis/util/exception.hh>
@@ -41,13 +41,13 @@
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/choice.hh>
#include <paludis/dep_spec_annotations.hh>
+#include <paludis/unformatted_pretty_printer.hh>
#include <vector>
#include <limits>
#include <sstream>
@@ -64,7 +64,7 @@ namespace
struct MyOptionsRewriter
{
- StringifyFormatter f;
+ UnformattedPrettyPrinter f;
std::stringstream str;
std::string prefix;
@@ -95,7 +95,7 @@ namespace
void visit(const PlainTextSpecTree::NodeType<ConditionalDepSpec>::Type & node)
{
Save<std::string> save_prefix(&prefix);
- str << f.format(*node.spec(), format::Plain()) << " ( ";
+ str << f.prettify(*node.spec()) << " ( ";
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(*this));
str << " ) ";
do_annotations(*node.spec(), "");
@@ -103,14 +103,14 @@ namespace
void visit(const PlainTextSpecTree::NodeType<PlainTextDepSpec>::Type & node)
{
- str << f.format(*node.spec(), format::Plain()) << " ";
+ str << f.prettify(*node.spec()) << " ";
do_annotations(*node.spec(), (prefix.empty() ? "" : prefix + joiner) + stringify(*node.spec()));
}
void visit(const PlainTextSpecTree::NodeType<PlainTextLabelDepSpec>::Type & node)
{
prefix = node.spec()->label();
- str << f.format(*node.spec(), format::Plain()) << " ";
+ str << f.prettify(*node.spec()) << " ";
do_annotations(*node.spec(), "");
}
@@ -470,8 +470,8 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
std::shared_ptr<const DependencySpecTree> before(mm->value());
std::shared_ptr<const DependencySpecTree> after(fix_locked_dependencies(
environment, *eapi, package_id, before));
- StringifyFormatter ff;
- DepSpecPrettyPrinter p(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ UnformattedPrettyPrinter ff;
+ SpecTreePrettyPrinter p(ff, { });
after->top()->accept(p);
return "O0;" + stringify(p);
}
@@ -488,7 +488,6 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
if (! mm)
throw InternalError(PALUDIS_HERE, "oops. key '" + var + "' isn't a PlainTextSpecTree key");
- StringifyFormatter ff;
MyOptionsRewriter p(package_id,
eapi->supported()->annotations()->general_description(),
std::string(1, eapi->supported()->choices_options()->use_expand_separator()));
diff --git a/paludis/repositories/e/required_use_verifier.cc b/paludis/repositories/e/required_use_verifier.cc
index e46d26293..962034f1c 100644
--- a/paludis/repositories/e/required_use_verifier.cc
+++ b/paludis/repositories/e/required_use_verifier.cc
@@ -26,7 +26,6 @@
#include <paludis/action.hh>
#include <paludis/metadata_key.hh>
#include <paludis/choice.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/unformatted_pretty_printer.hh>
#include <list>
#include <algorithm>
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index c6c7b2867..8120531bb 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -24,7 +24,6 @@
#include <paludis/repositories/e/eapi_phase.hh>
#include <paludis/repositories/e/eapi.hh>
#include <paludis/repositories/e/dep_parser.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/e/e_repository_params.hh>
#include <paludis/repositories/e/e_repository.hh>
#include <paludis/repositories/e/extra_distribution_data.hh>
@@ -49,7 +48,6 @@
#include <paludis/set_file.hh>
#include <paludis/version_operator.hh>
#include <paludis/version_requirements.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
#include <paludis/filtered_generator.hh>
@@ -57,6 +55,7 @@
#include <paludis/output_manager.hh>
#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/dep_spec_annotations.hh>
+#include <paludis/unformatted_pretty_printer.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/fast_unique_copy.hh>
@@ -1196,7 +1195,7 @@ namespace
bool changed;
std::stringstream str;
- StringifyFormatter f;
+ UnformattedPrettyPrinter f;
DepRewriter(const DepRewrites & w) :
rewrites(w),
@@ -1236,13 +1235,13 @@ namespace
{
/* don't rewrite blocks. some people block the old package after
* doing a move. */
- str << f.format(*node.spec(), format::Plain()) << " ";
+ str << f.prettify(*node.spec()) << " ";
do_annotations(*node.spec());
}
void visit(const DependencySpecTree::NodeType<DependenciesLabelsDepSpec>::Type & node)
{
- str << f.format(*node.spec(), format::Plain()) << " ";
+ str << f.prettify(*node.spec()) << " ";
do_annotations(*node.spec());
}
@@ -1251,19 +1250,18 @@ namespace
if (node.spec()->package_ptr() && rewrites.end() != rewrites.find(*node.spec()->package_ptr()))
{
changed = true;
- str << f.format(PartiallyMadePackageDepSpec(*node.spec())
- .package(rewrites.find(*node.spec()->package_ptr())->second),
- format::Plain()) << " ";
+ str << f.prettify(PartiallyMadePackageDepSpec(*node.spec())
+ .package(rewrites.find(*node.spec()->package_ptr())->second)) << " ";
}
else
- str << f.format(*node.spec(), format::Plain()) << " ";
+ str << f.prettify(*node.spec()) << " ";
do_annotations(*node.spec());
}
void visit(const DependencySpecTree::NodeType<ConditionalDepSpec>::Type & node)
{
- str << f.format(*node.spec(), format::Plain()) << " ( ";
+ str << f.prettify(*node.spec()) << " ( ";
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(*this));
str << " ) ";
do_annotations(*node.spec());
@@ -1271,7 +1269,7 @@ namespace
void visit(const DependencySpecTree::NodeType<NamedSetDepSpec>::Type & node)
{
- str << f.format(*node.spec(), format::Plain()) << " ";
+ str << f.prettify(*node.spec()) << " ";
do_annotations(*node.spec());
}
};
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index f6f616fa0..a0205b5ec 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -18,8 +18,8 @@
*/
#include <paludis/repositories/e/vdb_repository.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/e/e_repository.hh>
+#include <paludis/repositories/e/spec_tree_pretty_printer.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
@@ -37,9 +37,9 @@
#include <paludis/selection.hh>
#include <paludis/dep_spec.hh>
#include <paludis/user_dep_spec.hh>
-#include <paludis/stringify_formatter.hh>
#include <paludis/action.hh>
#include <paludis/choice.hh>
+#include <paludis/unformatted_pretty_printer.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_null_shared_ptr.hh>
@@ -280,19 +280,19 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("category/package",
&env, { })), { }))]->begin());
- StringifyFormatter ff;
+ UnformattedPrettyPrinter ff;
- erepository::DepSpecPrettyPrinter pd(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ erepository::SpecTreePrettyPrinter pd(ff, { });
TEST_CHECK(bool(id->build_dependencies_key()));
id->build_dependencies_key()->value()->top()->accept(pd);
TEST_CHECK_STRINGIFY_EQUAL(pd, "( cat/pkg1 build: cat/pkg2 build+run: cat/pkg3 suggestion: post: )");
- erepository::DepSpecPrettyPrinter pr(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ erepository::SpecTreePrettyPrinter pr(ff, { });
TEST_CHECK(bool(id->run_dependencies_key()));
id->run_dependencies_key()->value()->top()->accept(pr);
TEST_CHECK_STRINGIFY_EQUAL(pr, "( cat/pkg1 build: build+run: cat/pkg3 suggestion: post: )");
- erepository::DepSpecPrettyPrinter pp(0, std::shared_ptr<const PackageID>(), ff, 0, false, false);
+ erepository::SpecTreePrettyPrinter pp(ff, { });
TEST_CHECK(bool(id->post_dependencies_key()));
id->post_dependencies_key()->value()->top()->accept(pp);
TEST_CHECK_STRINGIFY_EQUAL(pp, "( build: build+run: suggestion: cat/pkg4 post: cat/pkg5 )");