aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-10-12 21:26:47 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-10-12 22:17:28 +0100
commit918a0b2a9063416885081bb52a1164bf6b7a40ea (patch)
treeab20c1c6837477ef63da90b79a9cc10446fb4ec6
parent4a771032711c4cfbf9cb6e96fd6fee553e491d0f (diff)
downloadpaludis-918a0b2a9063416885081bb52a1164bf6b7a40ea.tar.gz
paludis-918a0b2a9063416885081bb52a1164bf6b7a40ea.tar.xz
Don't bother formatting things where unnecessary.
-rw-r--r--paludis/dep_list_TEST.cc8
-rw-r--r--paludis/repositories/e/dep_parser_TEST.cc42
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer.cc20
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer.hh7
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer_TEST.cc22
-rw-r--r--paludis/repositories/e/e_key.cc24
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc14
-rw-r--r--paludis/repositories/e/e_repository_sets_TEST.cc6
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc2
-rw-r--r--paludis/repositories/e/fix_locked_dependencies_TEST.cc8
-rw-r--r--paludis/repositories/e/pipe_command_handler.cc2
-rw-r--r--paludis/repositories/e/qa/visibility.cc2
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc6
13 files changed, 87 insertions, 76 deletions
diff --git a/paludis/dep_list_TEST.cc b/paludis/dep_list_TEST.cc
index 5e6057f..b1bdd13 100644
--- a/paludis/dep_list_TEST.cc
+++ b/paludis/dep_list_TEST.cc
@@ -2165,7 +2165,7 @@ namespace test_cases
cat_three_has_tag_from_cat_one = true;
TEST_CHECK_STRINGIFY_EQUAL(*tag->dependency(), "cat/three");
StringifyFormatter ff;
- erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
tag->conditions()->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "cat/three");
}
@@ -2176,7 +2176,7 @@ namespace test_cases
{
cat_three_has_first_tag_from_cat_two = true;
StringifyFormatter ff;
- erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
tag->conditions()->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "enabled? ( || ( <cat/three-1 ) )");
}
@@ -2184,7 +2184,7 @@ namespace test_cases
{
cat_three_has_second_tag_from_cat_two = true;
StringifyFormatter ff;
- erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
tag->conditions()->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "enabled? ( || ( cat/three:0 ) )");
}
@@ -2211,7 +2211,7 @@ namespace test_cases
TEST_CHECK_EQUAL(deptag->short_text(), "cat/two-1:0::repo");
TEST_CHECK_STRINGIFY_EQUAL(*deptag->dependency(), "=cat/four-1");
StringifyFormatter ff;
- erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
deptag->conditions()->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "enabled? ( || ( =cat/four-1 ) )");
diff --git a/paludis/repositories/e/dep_parser_TEST.cc b/paludis/repositories/e/dep_parser_TEST.cc
index 6c7f168..c5c91f9 100644
--- a/paludis/repositories/e/dep_parser_TEST.cc
+++ b/paludis/repositories/e/dep_parser_TEST.cc
@@ -57,7 +57,7 @@ namespace test_cases
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
StringifyFormatter ff;
- DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend("",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "");
@@ -80,7 +80,7 @@ namespace test_cases
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
StringifyFormatter ff;
- DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend(" \n \t",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "");
@@ -103,7 +103,7 @@ namespace test_cases
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
StringifyFormatter ff;
- DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend("app-editors/vim",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "app-editors/vim");
@@ -126,17 +126,17 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d1(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d1(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend(">=app-editors/vim-6.4_alpha",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d1);
TEST_CHECK_EQUAL(stringify(d1), ">=app-editors/vim-6.4_alpha");
- DepSpecPrettyPrinter d2(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d2(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend("=app-editors/vim-6.4_alpha-r1",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d2);
TEST_CHECK_EQUAL(stringify(d2), "=app-editors/vim-6.4_alpha-r1");
- DepSpecPrettyPrinter d3(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d3(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend(">=app-editors/vim-6.4_alpha:one",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d3);
TEST_CHECK_EQUAL(stringify(d3), ">=app-editors/vim-6.4_alpha:one");
@@ -159,7 +159,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend("app-editors/vim app-misc/hilite \nsys-apps/findutils",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "app-editors/vim app-misc/hilite sys-apps/findutils");
@@ -178,7 +178,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend("|| ( one/one two/two )",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "|| ( one/one two/two )");
@@ -197,7 +197,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend("|| ( one/one foo? ( two/two ) )",
&env, id, *EAPIData::get_instance()->eapi_from_string("0"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "|| ( one/one foo? ( two/two ) )");
@@ -205,7 +205,7 @@ namespace test_cases
TEST_CHECK_THROWS(parse_depend("|| ( one/one foo? ( two/two ) )",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), Exception);
- DepSpecPrettyPrinter e(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter e(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend("|| ( one/one ( foo? ( two/two ) ) )",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(e);
TEST_CHECK_EQUAL(stringify(e), "|| ( one/one ( foo? ( two/two ) ) )");
@@ -228,7 +228,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend(" ( one/one two/two ) ",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "one/one two/two");
@@ -251,7 +251,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend("foo? ( one/one )", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "foo? ( one/one )");
}
@@ -273,7 +273,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend("!foo? ( one/one )", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "!foo? ( one/one )");
}
@@ -291,11 +291,11 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, true);
+ DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, true, false);
parse_fetchable_uri("a\n->\tb", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "a -> b\n");
- DepSpecPrettyPrinter e(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, true);
+ DepSpecPrettyPrinter e(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, true, false);
parse_fetchable_uri("a-> b", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(e);
TEST_CHECK_EQUAL(stringify(e), "a->\nb\n");
@@ -320,7 +320,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
TEST_CHECK_THROWS(parse_depend("!foo? ( one/one",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), Exception);
TEST_CHECK_THROWS(parse_depend("!foo? ( one/one ) )",
@@ -350,7 +350,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
TEST_CHECK_THROWS(parse_depend("||",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), Exception);
TEST_CHECK_THROWS(parse_depend("|| ",
@@ -402,7 +402,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend("build: one/one",
&env, id, *EAPIData::get_instance()->eapi_from_string("exheres-0"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "build: one/one");
@@ -423,7 +423,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_fetchable_uri("http://foo/bar manual: two",
&env, id, *EAPIData::get_instance()->eapi_from_string("kdebuild-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "http://foo/bar manual: two");
@@ -444,12 +444,12 @@ namespace test_cases
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
StringifyFormatter ff;
- DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend("cat/first [[ foo = bar bar = baz ]] cat/second cat/third [[ moo = oink ]]",
&env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "cat/first [[ bar = [ baz ] foo = [ bar ] ]] cat/second cat/third [[ moo = [ oink ] ]]");
- DepSpecPrettyPrinter e(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter e(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
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"))->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
index 95b4b6a..7cd184f 100644
--- a/paludis/repositories/e/dep_spec_pretty_printer.cc
+++ b/paludis/repositories/e/dep_spec_pretty_printer.cc
@@ -61,13 +61,15 @@ namespace paludis
bool outer_block;
bool all_needs_parens;
bool need_space;
+ bool check_conditions;
Implementation(
const Environment * const e,
const std::tr1::shared_ptr<const PackageID> & i,
const GenericSpecTree::ItemFormatter & f,
unsigned in,
- bool b) :
+ bool b,
+ bool c) :
env(e),
id(i),
formatter(f),
@@ -76,7 +78,8 @@ namespace paludis
use_newlines(b),
outer_block(true),
all_needs_parens(false),
- need_space(false)
+ need_space(false),
+ check_conditions(c)
{
}
};
@@ -87,8 +90,9 @@ DepSpecPrettyPrinter::DepSpecPrettyPrinter(
const std::tr1::shared_ptr<const PackageID> & id,
const GenericSpecTree::ItemFormatter & f,
unsigned i,
- bool b) :
- PrivateImplementationPattern<DepSpecPrettyPrinter>(new Implementation<DepSpecPrettyPrinter>(e, id, f, i, b))
+ bool b,
+ bool c) :
+ PrivateImplementationPattern<DepSpecPrettyPrinter>(new Implementation<DepSpecPrettyPrinter>(e, id, f, i, b, c))
{
}
@@ -271,7 +275,9 @@ DepSpecPrettyPrinter::visit_sequence(const ConditionalDepSpec & a,
else if (_imp->need_space)
_imp->s << " ";
- if (a.condition_met())
+ if (! _imp->check_conditions)
+ _imp->s << _imp->formatter.format(a, format::Plain()) << " (";
+ else if (a.condition_met())
_imp->s << _imp->formatter.format(a, format::Enabled()) << " (";
else
_imp->s << _imp->formatter.format(a, format::Disabled()) << " (";
@@ -309,7 +315,7 @@ DepSpecPrettyPrinter::visit_leaf(const PackageDepSpec & p)
else if (_imp->need_space)
_imp->s << " ";
- if (_imp->env)
+ if (_imp->env && _imp->check_conditions)
{
if (! (*_imp->env)[selection::SomeArbitraryVersion(generator::Matches(p) |
filter::InstalledAtRoot(_imp->env->root()))]->empty())
@@ -375,7 +381,7 @@ DepSpecPrettyPrinter::visit_leaf(const LicenseDepSpec & p)
else if (_imp->need_space)
_imp->s << " ";
- if (_imp->env && _imp->id)
+ if (_imp->env && _imp->id && _imp->check_conditions)
{
if (_imp->env->accept_license(p.text(), *_imp->id))
_imp->s << _imp->formatter.format(p, format::Accepted());
diff --git a/paludis/repositories/e/dep_spec_pretty_printer.hh b/paludis/repositories/e/dep_spec_pretty_printer.hh
index cb73c50..e563f82 100644
--- a/paludis/repositories/e/dep_spec_pretty_printer.hh
+++ b/paludis/repositories/e/dep_spec_pretty_printer.hh
@@ -72,13 +72,18 @@ namespace paludis
* 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::tr1::shared_ptr<const PackageID> & id,
const GenericSpecTree::ItemFormatter & formatter,
unsigned initial_indent,
- bool use_newlines);
+ bool use_newlines,
+ bool check_conditions);
~DepSpecPrettyPrinter();
diff --git a/paludis/repositories/e/dep_spec_pretty_printer_TEST.cc b/paludis/repositories/e/dep_spec_pretty_printer_TEST.cc
index 607c3cc..479d7e0 100644
--- a/paludis/repositories/e/dep_spec_pretty_printer_TEST.cc
+++ b/paludis/repositories/e/dep_spec_pretty_printer_TEST.cc
@@ -47,27 +47,27 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter p1(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter p1(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend("foo/bar bar/baz", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p1);
TEST_CHECK_STRINGIFY_EQUAL(p1, "foo/bar bar/baz");
- DepSpecPrettyPrinter p2(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter p2(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend("foo/bar moo? ( bar/baz )", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p2);
TEST_CHECK_STRINGIFY_EQUAL(p2, "foo/bar moo? ( bar/baz )");
- DepSpecPrettyPrinter p3(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter p3(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_depend("|| ( a/b ( c/d e/f ) )", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p3);
TEST_CHECK_STRINGIFY_EQUAL(p3, "|| ( a/b ( c/d e/f ) )");
- DepSpecPrettyPrinter p4(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter p4(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_license("( ( ( ) a ) b )", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p4);
TEST_CHECK_STRINGIFY_EQUAL(p4, "a b");
- DepSpecPrettyPrinter p5(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter p5(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_fetchable_uri("( a -> b c x? ( d e ) )", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p5);
TEST_CHECK_STRINGIFY_EQUAL(p5, "a -> b c x? ( d e )");
- DepSpecPrettyPrinter p6(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter p6(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
parse_fetchable_uri("a manual: b x? ( c mirrors-first: d manual: e ) f",
&env, id, *EAPIData::get_instance()->eapi_from_string("exheres-0"))->accept(p6);
TEST_CHECK_STRINGIFY_EQUAL(p6, "a manual: b x? ( c mirrors-first: d manual: e ) f");
@@ -86,24 +86,24 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- DepSpecPrettyPrinter p1(0, std::tr1::shared_ptr<const PackageID>(), ff, 1, true);
+ DepSpecPrettyPrinter p1(0, std::tr1::shared_ptr<const PackageID>(), ff, 1, true, false);
parse_depend("foo/bar bar/baz", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p1);
TEST_CHECK_STRINGIFY_EQUAL(p1, " foo/bar\n bar/baz\n");
- DepSpecPrettyPrinter p2(0, std::tr1::shared_ptr<const PackageID>(), ff, 1, true);
+ DepSpecPrettyPrinter p2(0, std::tr1::shared_ptr<const PackageID>(), ff, 1, true, false);
parse_depend("foo/bar moo? ( bar/baz )", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p2);
TEST_CHECK_STRINGIFY_EQUAL(p2, " foo/bar\n moo? (\n bar/baz\n )\n");
- DepSpecPrettyPrinter p3(0, std::tr1::shared_ptr<const PackageID>(), ff, 1, true);
+ DepSpecPrettyPrinter p3(0, std::tr1::shared_ptr<const PackageID>(), ff, 1, true, false);
parse_depend("|| ( a/b ( c/d e/f ) )", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p3);
TEST_CHECK_STRINGIFY_EQUAL(p3, " || (\n a/b\n (\n c/d\n"
" e/f\n )\n )\n");
- DepSpecPrettyPrinter p4(0, std::tr1::shared_ptr<const PackageID>(), ff, 1, true);
+ DepSpecPrettyPrinter p4(0, std::tr1::shared_ptr<const PackageID>(), ff, 1, true, false);
parse_license("( ( ( ) a ) b )", &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p4);
TEST_CHECK_STRINGIFY_EQUAL(p4, " a\n b\n");
- DepSpecPrettyPrinter p5(0, std::tr1::shared_ptr<const PackageID>(), ff, 1, true);
+ DepSpecPrettyPrinter p5(0, std::tr1::shared_ptr<const PackageID>(), ff, 1, true, false);
parse_fetchable_uri("a manual: b x? ( c mirrors-first: d manual: e ) f",
&env, id, *EAPIData::get_instance()->eapi_from_string("exheres-0"))->accept(p5);
TEST_CHECK_STRINGIFY_EQUAL(p5, " a\n manual:\n b\n x? (\n c\n"
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index e6ec636..8e9ed36 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -144,7 +144,7 @@ std::string
EDependenciesKey::pretty_print(const DependencySpecTree::ItemFormatter & f) const
{
StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true);
+ DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true, true);
value()->accept(p);
return stringify(p);
}
@@ -153,7 +153,7 @@ std::string
EDependenciesKey::pretty_print_flat(const DependencySpecTree::ItemFormatter & f) const
{
StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false);
+ DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false, true);
value()->accept(p);
return stringify(p);
}
@@ -217,7 +217,7 @@ std::string
ELicenseKey::pretty_print(const LicenseSpecTree::ItemFormatter & f) const
{
StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true);
+ DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true, true);
value()->accept(p);
return stringify(p);
}
@@ -226,7 +226,7 @@ std::string
ELicenseKey::pretty_print_flat(const LicenseSpecTree::ItemFormatter & f) const
{
StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false);
+ DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false, true);
value()->accept(p);
return stringify(p);
}
@@ -282,7 +282,7 @@ std::string
EFetchableURIKey::pretty_print(const FetchableURISpecTree::ItemFormatter & f) const
{
StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true);
+ DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true, true);
value()->accept(p);
return stringify(p);
}
@@ -291,7 +291,7 @@ std::string
EFetchableURIKey::pretty_print_flat(const FetchableURISpecTree::ItemFormatter & f) const
{
StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false);
+ DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false, true);
value()->accept(p);
return stringify(p);
}
@@ -382,7 +382,7 @@ std::string
ESimpleURIKey::pretty_print(const SimpleURISpecTree::ItemFormatter & f) const
{
StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true);
+ DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true, true);
value()->accept(p);
return stringify(p);
}
@@ -391,7 +391,7 @@ std::string
ESimpleURIKey::pretty_print_flat(const SimpleURISpecTree::ItemFormatter & f) const
{
StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false);
+ DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false, true);
value()->accept(p);
return stringify(p);
}
@@ -446,7 +446,7 @@ std::string
EPlainTextSpecKey::pretty_print(const PlainTextSpecTree::ItemFormatter & f) const
{
StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true);
+ DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true, true);
value()->accept(p);
return stringify(p);
}
@@ -455,7 +455,7 @@ std::string
EPlainTextSpecKey::pretty_print_flat(const PlainTextSpecTree::ItemFormatter & f) const
{
StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false);
+ DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false, true);
value()->accept(p);
return stringify(p);
}
@@ -509,7 +509,7 @@ std::string
EProvideKey::pretty_print(const ProvideSpecTree::ItemFormatter & f) const
{
StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true);
+ DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, true, true);
value()->accept(p);
return stringify(p);
}
@@ -518,7 +518,7 @@ std::string
EProvideKey::pretty_print_flat(const ProvideSpecTree::ItemFormatter & f) const
{
StringifyFormatter ff(f);
- DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false);
+ DepSpecPrettyPrinter p(_imp->env, _imp->id, ff, 0, false, true);
value()->accept(p);
return stringify(p);
}
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index dc8f074..0be6ad5 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -487,11 +487,11 @@ namespace test_cases
TEST_CHECK(id1->short_description_key());
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Description");
StringifyFormatter ff;
- erepository::DepSpecPrettyPrinter pd(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pd(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
TEST_CHECK(id1->build_dependencies_key());
id1->build_dependencies_key()->value()->accept(pd);
TEST_CHECK_STRINGIFY_EQUAL(pd, "foo/bar");
- erepository::DepSpecPrettyPrinter pr(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pr(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
TEST_CHECK(id1->run_dependencies_key());
id1->run_dependencies_key()->value()->accept(pr);
TEST_CHECK_STRINGIFY_EQUAL(pr, "foo/bar");
@@ -503,11 +503,11 @@ namespace test_cases
TEST_CHECK(id2->end_metadata() != id2->find_metadata("EAPI"));
TEST_CHECK(id2->short_description_key());
TEST_CHECK_EQUAL(id2->short_description_key()->value(), "dquote \" squote ' backslash \\ dollar $");
- erepository::DepSpecPrettyPrinter pd2(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pd2(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
TEST_CHECK(id2->build_dependencies_key());
id2->build_dependencies_key()->value()->accept(pd2);
TEST_CHECK_STRINGIFY_EQUAL(pd2, "foo/bar bar/baz");
- erepository::DepSpecPrettyPrinter pr2(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pr2(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
TEST_CHECK(id2->run_dependencies_key());
id2->run_dependencies_key()->value()->accept(pr2);
TEST_CHECK_STRINGIFY_EQUAL(pr2, "foo/bar");
@@ -2166,17 +2166,17 @@ namespace test_cases
StringifyFormatter ff;
- erepository::DepSpecPrettyPrinter pd(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pd(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
TEST_CHECK(id->build_dependencies_key());
id->build_dependencies_key()->value()->accept(pd);
TEST_CHECK_STRINGIFY_EQUAL(pd, "( cat/pkg1 build: cat/pkg2 build,run: cat/pkg3 suggested: cat/pkg4 post: )");
- erepository::DepSpecPrettyPrinter pr(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pr(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
TEST_CHECK(id->run_dependencies_key());
id->run_dependencies_key()->value()->accept(pr);
TEST_CHECK_STRINGIFY_EQUAL(pr, "( cat/pkg1 build: build,run: cat/pkg3 suggested: cat/pkg4 post: )");
- erepository::DepSpecPrettyPrinter pp(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pp(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
TEST_CHECK(id->post_dependencies_key());
id->post_dependencies_key()->value()->accept(pp);
TEST_CHECK_STRINGIFY_EQUAL(pp, "( build: build,run: suggested: post: cat/pkg5 )");
diff --git a/paludis/repositories/e/e_repository_sets_TEST.cc b/paludis/repositories/e/e_repository_sets_TEST.cc
index 716aece..ec212e9 100644
--- a/paludis/repositories/e/e_repository_sets_TEST.cc
+++ b/paludis/repositories/e/e_repository_sets_TEST.cc
@@ -93,7 +93,7 @@ namespace test_cases
std::tr1::shared_ptr<SetSpecTree::ConstItem> set1(repo->sets_interface()->package_set(SetName("set1")));
StringifyFormatter ff;
- erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
set1->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "cat-one/foo >=cat-two/bar-2");
}
@@ -123,7 +123,7 @@ namespace test_cases
std::tr1::shared_ptr<SetSpecTree::ConstItem> insecurity(repo->sets_interface()->package_set(SetName("insecurity")));
StringifyFormatter ff;
- erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
insecurity->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "=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 "
@@ -161,7 +161,7 @@ namespace test_cases
std::tr1::shared_ptr<const SetSpecTree::ConstItem> security(repo->sets_interface()->package_set(SetName("security")));
StringifyFormatter ff;
- erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
security->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "=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 f252744..d90872c 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -623,7 +623,7 @@ namespace
std::string flatten(const T_ & d)
{
StringifyFormatter ff;
- DepSpecPrettyPrinter p(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter p(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
d->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 fe3eedc..6083d55 100644
--- a/paludis/repositories/e/fix_locked_dependencies_TEST.cc
+++ b/paludis/repositories/e/fix_locked_dependencies_TEST.cc
@@ -60,8 +60,8 @@ namespace test_cases
StringifyFormatter ff;
DepSpecPrettyPrinter
- a(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false),
- b(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ a(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false),
+ b(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
aa->accept(a);
bb->accept(b);
@@ -72,8 +72,8 @@ namespace test_cases
dd(fix_locked_dependencies(&env, *eapi, id, cc));
DepSpecPrettyPrinter
- c(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false),
- d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ c(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false),
+ d(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
cc->accept(c);
dd->accept(d);
diff --git a/paludis/repositories/e/pipe_command_handler.cc b/paludis/repositories/e/pipe_command_handler.cc
index 286d282..a6e28b5 100644
--- a/paludis/repositories/e/pipe_command_handler.cc
+++ b/paludis/repositories/e/pipe_command_handler.cc
@@ -246,7 +246,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
std::tr1::shared_ptr<const DependencySpecTree::ConstItem> after(fix_locked_dependencies(
environment, *eapi, package_id, before));
StringifyFormatter ff;
- DepSpecPrettyPrinter p(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter p(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
after->accept(p);
return "O0;" + stringify(p);
}
diff --git a/paludis/repositories/e/qa/visibility.cc b/paludis/repositories/e/qa/visibility.cc
index 8bd62d4..7c5a4cd 100644
--- a/paludis/repositories/e/qa/visibility.cc
+++ b/paludis/repositories/e/qa/visibility.cc
@@ -254,7 +254,7 @@ namespace
if (reporter)
{
StringifyFormatter ff;
- DepSpecPrettyPrinter printer(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ DepSpecPrettyPrinter printer(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
std::for_each(begin, end, accept_visitor(printer));
reporter->message(QAMessage(entry, qaml_normal, name, "No item in block '|| ( "
+ stringify(printer) + " )' visible for profile '"
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index eadc5ca..be39ae4 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -270,17 +270,17 @@ namespace test_cases
StringifyFormatter ff;
- erepository::DepSpecPrettyPrinter pd(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pd(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
TEST_CHECK(id->build_dependencies_key());
id->build_dependencies_key()->value()->accept(pd);
TEST_CHECK_STRINGIFY_EQUAL(pd, "( cat/pkg1 build: cat/pkg2 build,run: cat/pkg3 suggested: cat/pkg4 post: )");
- erepository::DepSpecPrettyPrinter pr(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pr(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
TEST_CHECK(id->run_dependencies_key());
id->run_dependencies_key()->value()->accept(pr);
TEST_CHECK_STRINGIFY_EQUAL(pr, "( cat/pkg1 build: build,run: cat/pkg3 suggested: cat/pkg4 post: )");
- erepository::DepSpecPrettyPrinter pp(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ erepository::DepSpecPrettyPrinter pp(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
TEST_CHECK(id->post_dependencies_key());
id->post_dependencies_key()->value()->accept(pp);
TEST_CHECK_STRINGIFY_EQUAL(pp, "( build: build,run: suggested: post: cat/pkg5 )");