aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-10-21 22:00:49 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-10-21 22:01:52 +0100
commitcbcd4493d29a3309ffc52f9b91c2fad0ad942ae2 (patch)
treef51da5b08588d68a6d6e649c6da71c29b68ffeb7
parent576e0a19ba6bbf718d050f5743d687c3afc67641 (diff)
downloadpaludis-cbcd4493d29a3309ffc52f9b91c2fad0ad942ae2.tar.gz
paludis-cbcd4493d29a3309ffc52f9b91c2fad0ad942ae2.tar.xz
Consistent ctor style
-rw-r--r--paludis/dep_list_TEST.cc81
-rw-r--r--paludis/dep_list_TEST.hh8
-rw-r--r--paludis/filter_TEST.cc8
-rw-r--r--paludis/generator_TEST.cc8
-rw-r--r--paludis/package_database_TEST.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc56
-rw-r--r--paludis/repositories/e/e_repository_TEST_ever.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_exlibs.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_phases.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_replacing.cc8
-rw-r--r--paludis/repositories/e/e_repository_sets_TEST.cc19
-rw-r--r--paludis/repositories/e/fix_locked_dependencies_TEST.cc8
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc15
-rw-r--r--paludis/repositories/fake/fake_installed_repository.hh23
-rw-r--r--paludis/repositories/fake/fake_installed_repository_TEST.cc11
-rw-r--r--paludis/repositories/virtuals/virtuals_repository_TEST.cc16
-rw-r--r--paludis/resolver/resolver_test.cc8
-rw-r--r--paludis/uninstall_list_TEST.cc8
-rw-r--r--paludis/user_dep_spec_TEST.cc8
-rw-r--r--ruby/repository.cc7
-rw-r--r--src/clients/adjutrix/display_default_system_resolution.cc12
-rw-r--r--src/clients/adjutrix/what_needs_keywording.cc12
22 files changed, 289 insertions, 59 deletions
diff --git a/paludis/dep_list_TEST.cc b/paludis/dep_list_TEST.cc
index 63337c5..28f7c67 100644
--- a/paludis/dep_list_TEST.cc
+++ b/paludis/dep_list_TEST.cc
@@ -1933,8 +1933,13 @@ namespace test_cases
value_for<n::environment>(&env),
value_for<n::name>(RepositoryName("repo")))));
env.package_database()->add_repository(1, repo);
- std::tr1::shared_ptr<FakeInstalledRepository> destination_repo(new FakeInstalledRepository(&env,
- RepositoryName("installed_repo")));
+ std::tr1::shared_ptr<FakeInstalledRepository> destination_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed_repo")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, destination_repo);
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("cat/two cat/three");
@@ -1975,8 +1980,13 @@ namespace test_cases
value_for<n::environment>(&env),
value_for<n::name>(RepositoryName("repo")))));
env.package_database()->add_repository(1, repo);
- std::tr1::shared_ptr<FakeInstalledRepository> destination_repo(new FakeInstalledRepository(&env,
- RepositoryName("installed_repo")));
+ std::tr1::shared_ptr<FakeInstalledRepository> destination_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed_repo")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, destination_repo);
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("cat/two cat/three");
@@ -2020,8 +2030,13 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1");
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(
- new FakeInstalledRepository(&env, RepositoryName("installed_repo")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed_repo")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, installed_repo);
installed_repo->add_version("cat", "one", "2");
@@ -2049,8 +2064,13 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("cat/two");
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(
- new FakeInstalledRepository(&env, RepositoryName("installed_repo")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed_repo")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, installed_repo);
installed_repo->add_version("cat", "two", "2");
@@ -2079,8 +2099,13 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("cat/two");
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(
- new FakeInstalledRepository(&env, RepositoryName("installed_repo")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed_repo")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, installed_repo);
installed_repo->add_version("cat", "two", "2");
@@ -2111,8 +2136,13 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("cat/two");
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(
- new FakeInstalledRepository(&env, RepositoryName("installed_repo")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed_repo")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, installed_repo);
installed_repo->add_version("cat", "two", "2");
installed_repo->add_version("cat", "three", "3");
@@ -2165,8 +2195,13 @@ namespace test_cases
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("cat/two");
repo->add_version("cat", "two", "2");
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(
- new FakeInstalledRepository(&env, RepositoryName("installed_repo")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed_repo")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, installed_repo);
installed_repo->add_version("cat", "two", "0");
@@ -2211,8 +2246,13 @@ namespace test_cases
repo->add_version("cat", "five-svn", "0");
repo->add_version("cat", "six-darcs", "0");
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(
- new FakeInstalledRepository(&env, RepositoryName("installed_repo")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed_repo")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, installed_repo);
installed_repo->add_version("cat", "one", "scm");
installed_repo->add_version("cat", "two", "2");
@@ -2253,8 +2293,13 @@ namespace test_cases
repo->add_version("cat", "three", "0.9");
repo->add_version("cat", "four", "1");
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(
- new FakeInstalledRepository(&env, RepositoryName("installed_repo")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed_repo")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, installed_repo);
DepList d1(&env, DepListOptions());
diff --git a/paludis/dep_list_TEST.hh b/paludis/dep_list_TEST.hh
index 38cf6a4..75b15f8 100644
--- a/paludis/dep_list_TEST.hh
+++ b/paludis/dep_list_TEST.hh
@@ -129,7 +129,13 @@ namespace test_cases
repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
value_for<n::environment>(&env),
value_for<n::name>(RepositoryName("repo"))))),
- installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed"))),
+ installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ ))),
#ifdef ENABLE_VIRTUALS_REPOSITORY
virtuals_repo(RepositoryFactory::get_instance()->create(&env, virtuals_repo_keys)),
installed_virtuals_repo(RepositoryFactory::get_instance()->create(&env, installed_virtuals_repo_keys)),
diff --git a/paludis/filter_TEST.cc b/paludis/filter_TEST.cc
index 5692985..a96669a 100644
--- a/paludis/filter_TEST.cc
+++ b/paludis/filter_TEST.cc
@@ -62,7 +62,13 @@ namespace test_cases
value_for<n::environment>(&env),
value_for<n::name>(RepositoryName("repo2"))
))),
- inst_repo1(new FakeInstalledRepository(&env, RepositoryName("inst_repo1")))
+ inst_repo1(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("inst_repo1")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )))
{
env.package_database()->add_repository(1, repo1);
env.package_database()->add_repository(10, repo2);
diff --git a/paludis/generator_TEST.cc b/paludis/generator_TEST.cc
index b4e1840..4e23940 100644
--- a/paludis/generator_TEST.cc
+++ b/paludis/generator_TEST.cc
@@ -60,7 +60,13 @@ namespace test_cases
repo2(new FakeRepository(make_named_values<FakeRepositoryParams>(
value_for<n::environment>(&env),
value_for<n::name>(RepositoryName("repo2"))))),
- inst_repo1(new FakeInstalledRepository(&env, RepositoryName("inst_repo1")))
+ inst_repo1(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("inst_repo1")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )))
{
env.package_database()->add_repository(1, repo1);
env.package_database()->add_repository(10, repo2);
diff --git a/paludis/package_database_TEST.cc b/paludis/package_database_TEST.cc
index 62eba97..c43a0ab 100644
--- a/paludis/package_database_TEST.cc
+++ b/paludis/package_database_TEST.cc
@@ -167,7 +167,13 @@ namespace test_cases
p.add_repository(10, r3);
TEST_CHECK(true);
- std::tr1::shared_ptr<FakeInstalledRepository> r4(new FakeInstalledRepository(&e, RepositoryName("repo4")));
+ std::tr1::shared_ptr<FakeInstalledRepository> r4(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&e),
+ value_for<n::name>(RepositoryName("repo4")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
r4->add_version(CategoryNamePart("good-cat1") + PackageNamePart("pkg-installed"), VersionSpec("0", VersionSpecOptions()));
r4->add_version(CategoryNamePart("good-cat1") + PackageNamePart("pkg-fail4"), VersionSpec("0", VersionSpecOptions()));
r4->add_version(CategoryNamePart("good-cat2") + PackageNamePart("pkg-fail4"), VersionSpec("0", VersionSpecOptions()));
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 28bdf8d..f9ed7d5 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1110,7 +1110,13 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
installed_repo->add_version("cat", "pretend-installed", "0")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
installed_repo->add_version("cat", "pretend-installed", "1")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
env.package_database()->add_repository(2, installed_repo);
@@ -1391,7 +1397,13 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, installed_repo);
InstallAction action(make_named_values<InstallActionOptions>(
@@ -1487,7 +1499,13 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, installed_repo);
InstallAction action(make_named_values<InstallActionOptions>(
@@ -1613,7 +1631,13 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, installed_repo);
InstallAction action(make_named_values<InstallActionOptions>(
@@ -1785,7 +1809,13 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, installed_repo);
InstallAction action(make_named_values<InstallActionOptions>(
@@ -1910,7 +1940,13 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, installed_repo);
InfoActionOptions options(make_named_values<InfoActionOptions>(
@@ -1978,7 +2014,13 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
installed_repo->add_version("cat", "pretend-installed", "0")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
installed_repo->add_version("cat", "pretend-installed", "1")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
env.package_database()->add_repository(2, installed_repo);
diff --git a/paludis/repositories/e/e_repository_TEST_ever.cc b/paludis/repositories/e/e_repository_TEST_ever.cc
index 52ae1ec..ab01c9a 100644
--- a/paludis/repositories/e/e_repository_TEST_ever.cc
+++ b/paludis/repositories/e/e_repository_TEST_ever.cc
@@ -128,7 +128,13 @@ namespace
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
installed_repo->add_version("cat", "pretend-installed", "0")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
installed_repo->add_version("cat", "pretend-installed", "1")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
env.package_database()->add_repository(2, installed_repo);
diff --git a/paludis/repositories/e/e_repository_TEST_exlibs.cc b/paludis/repositories/e/e_repository_TEST_exlibs.cc
index 41eb9a0..bb3edce 100644
--- a/paludis/repositories/e/e_repository_TEST_exlibs.cc
+++ b/paludis/repositories/e/e_repository_TEST_exlibs.cc
@@ -136,7 +136,13 @@ namespace
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, installed_repo);
InstallAction action(make_named_values<InstallActionOptions>(
diff --git a/paludis/repositories/e/e_repository_TEST_phases.cc b/paludis/repositories/e/e_repository_TEST_phases.cc
index 4b2d93d..a6499e9 100644
--- a/paludis/repositories/e/e_repository_TEST_phases.cc
+++ b/paludis/repositories/e/e_repository_TEST_phases.cc
@@ -136,7 +136,13 @@ namespace
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
installed_repo->add_version("cat", "pretend-installed", "0")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
installed_repo->add_version("cat", "pretend-installed", "1")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
env.package_database()->add_repository(2, installed_repo);
diff --git a/paludis/repositories/e/e_repository_TEST_replacing.cc b/paludis/repositories/e/e_repository_TEST_replacing.cc
index 4ac86be..da06358 100644
--- a/paludis/repositories/e/e_repository_TEST_replacing.cc
+++ b/paludis/repositories/e/e_repository_TEST_replacing.cc
@@ -130,7 +130,13 @@ namespace
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
installed_repo->add_version("cat", replacing_pkg_name, "1")->set_slot(SlotName("1"));
installed_repo->add_version("cat", replacing_pkg_name, "2")->set_slot(SlotName("2"));
installed_repo->add_version("cat", replacing_pkg_name, "3")->set_slot(SlotName("3"));
diff --git a/paludis/repositories/e/e_repository_sets_TEST.cc b/paludis/repositories/e/e_repository_sets_TEST.cc
index 9969bd8..43f1e32 100644
--- a/paludis/repositories/e/e_repository_sets_TEST.cc
+++ b/paludis/repositories/e/e_repository_sets_TEST.cc
@@ -25,6 +25,7 @@
#include <paludis/util/system.hh>
#include <paludis/util/map.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/stringify_formatter.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -85,8 +86,13 @@ namespace test_cases
keys->insert("profiles", "e_repository_sets_TEST_dir/repo1/profiles/profile");
std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
- std::tr1::shared_ptr<FakeInstalledRepository> installed(
- new FakeInstalledRepository(&env, RepositoryName("installed")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
installed->add_version("cat-two", "bar", "1.5");
env.package_database()->add_repository(0, installed);
env.package_database()->add_repository(1, repo);
@@ -153,8 +159,13 @@ namespace test_cases
std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::tr1::shared_ptr<FakeInstalledRepository> installed(
- new FakeInstalledRepository(&env, RepositoryName("installed")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
installed->add_version("cat-one", "foo", "2.1");
installed->add_version("cat-two", "bar", "1.5");
installed->add_version("cat-three", "baz", "1.0");
diff --git a/paludis/repositories/e/fix_locked_dependencies_TEST.cc b/paludis/repositories/e/fix_locked_dependencies_TEST.cc
index ca9a535..4a78912 100644
--- a/paludis/repositories/e/fix_locked_dependencies_TEST.cc
+++ b/paludis/repositories/e/fix_locked_dependencies_TEST.cc
@@ -51,7 +51,13 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, installed_repo);
installed_repo->add_version("cat", "installed", "1")->set_slot(SlotName("monkey"));
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index e07076c..80afb5d 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -56,9 +56,8 @@ namespace paludis
};
}
-FakeInstalledRepository::FakeInstalledRepository(const Environment * const e, const RepositoryName & our_name,
- const bool supports_uninstall, const bool i) :
- FakeRepositoryBase(e, our_name, make_named_values<RepositoryCapabilities>(
+FakeInstalledRepository::FakeInstalledRepository(const FakeInstalledRepositoryParams & p) :
+ FakeRepositoryBase(p.environment(), p.name(), make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(this),
value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
@@ -68,7 +67,8 @@ FakeInstalledRepository::FakeInstalledRepository(const Environment * const e, co
value_for<n::provides_interface>(this),
value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
)),
- PrivateImplementationPattern<FakeInstalledRepository>(new Implementation<FakeInstalledRepository>(supports_uninstall, i)),
+ PrivateImplementationPattern<FakeInstalledRepository>(new Implementation<FakeInstalledRepository>(
+ p.supports_uninstall(), p.suitable_destination())),
_imp(PrivateImplementationPattern<FakeInstalledRepository>::_imp)
{
add_metadata_key(_imp->format_key);
@@ -225,7 +225,12 @@ FakeInstalledRepository::repository_factory_create(
Context context("When creating FakeInstalledRepository:");
RepositoryName name(f("name"));
- return make_shared_ptr(new FakeInstalledRepository(env, name));
+ return make_shared_ptr(new FakeInstalledRepository(make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(env),
+ value_for<n::name>(name),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
}
std::tr1::shared_ptr<const RepositoryNameSet>
diff --git a/paludis/repositories/fake/fake_installed_repository.hh b/paludis/repositories/fake/fake_installed_repository.hh
index a566d3a..c61a0b8 100644
--- a/paludis/repositories/fake/fake_installed_repository.hh
+++ b/paludis/repositories/fake/fake_installed_repository.hh
@@ -24,6 +24,25 @@
namespace paludis
{
+ namespace n
+ {
+ struct environment;
+ struct name;
+ struct suitable_destination;
+ struct supports_uninstall;
+ }
+
+ /**
+ * Parameters for a FakeInstalledRepository.
+ */
+ struct FakeInstalledRepositoryParams
+ {
+ NamedValue<n::environment, const Environment *> environment;
+ NamedValue<n::name, RepositoryName> name;
+ NamedValue<n::suitable_destination, bool> suitable_destination;
+ NamedValue<n::supports_uninstall, bool> supports_uninstall;
+ };
+
/**
* A fake repository for test cases, for installed packages.
*
@@ -61,8 +80,8 @@ namespace paludis
///\name Basic operations
///\{
- FakeInstalledRepository(const Environment * const, const RepositoryName &, const bool supports_uninstall = true,
- const bool suitable_destination = true);
+ ///\since 0.42
+ FakeInstalledRepository(const FakeInstalledRepositoryParams &);
~FakeInstalledRepository();
///\}
diff --git a/paludis/repositories/fake/fake_installed_repository_TEST.cc b/paludis/repositories/fake/fake_installed_repository_TEST.cc
index e9999f8..362d0da 100644
--- a/paludis/repositories/fake/fake_installed_repository_TEST.cc
+++ b/paludis/repositories/fake/fake_installed_repository_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 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
@@ -21,6 +21,7 @@
#include <test/test_framework.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/environments/test/test_environment.hh>
+#include <paludis/util/make_named_values.hh>
using namespace test;
using namespace paludis;
@@ -34,7 +35,13 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<const FakeInstalledRepository> r(new FakeInstalledRepository(&env, RepositoryName("fake")));
+ std::tr1::shared_ptr<const FakeInstalledRepository> r(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
}
} test_fake_installed_repository;
}
diff --git a/paludis/repositories/virtuals/virtuals_repository_TEST.cc b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
index a618913..90f5e31 100644
--- a/paludis/repositories/virtuals/virtuals_repository_TEST.cc
+++ b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
@@ -55,7 +55,13 @@ namespace test_cases
value_for<n::environment>(&env),
value_for<n::name>(RepositoryName("repo"))
)));
- std::tr1::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
TEST_CHECK(repo->virtuals_interface());
@@ -96,7 +102,13 @@ namespace test_cases
value_for<n::environment>(&env),
value_for<n::name>(RepositoryName("repo2"))
)));
- std::tr1::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ std::tr1::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(2, virtuals);
env.package_database()->add_repository(3, repo1);
diff --git a/paludis/resolver/resolver_test.cc b/paludis/resolver/resolver_test.cc
index d45fce2..cfd40c8 100644
--- a/paludis/resolver/resolver_test.cc
+++ b/paludis/resolver/resolver_test.cc
@@ -263,7 +263,13 @@ ResolverTestCase::ResolverTestCase(const std::string & t, const std::string & s,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1));
env.package_database()->add_repository(1, inst_repo);
- fake_inst_repo.reset(new FakeInstalledRepository(&env, RepositoryName("fake-inst"), true, false));
+ fake_inst_repo.reset(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake-inst")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(false)
+ )));
env.package_database()->add_repository(1, fake_inst_repo);
#ifdef ENABLE_VIRTUALS_REPOSITORY
diff --git a/paludis/uninstall_list_TEST.cc b/paludis/uninstall_list_TEST.cc
index 0a81968..dbba3ad 100644
--- a/paludis/uninstall_list_TEST.cc
+++ b/paludis/uninstall_list_TEST.cc
@@ -99,7 +99,13 @@ namespace test_cases
UninstallListTestCaseBase(const std::string & s) :
TestCase("uninstall list " + s),
env(),
- installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed"))),
+ installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ ))),
#ifdef ENABLE_VIRTUALS_REPOSITORY
virtuals_repo(RepositoryFactory::get_instance()->create(&env, virtuals_repo_keys)),
#endif
diff --git a/paludis/user_dep_spec_TEST.cc b/paludis/user_dep_spec_TEST.cc
index 5c38683..bd33d08 100644
--- a/paludis/user_dep_spec_TEST.cc
+++ b/paludis/user_dep_spec_TEST.cc
@@ -315,7 +315,13 @@ namespace test_cases
std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
value_for<n::environment>(&env),
value_for<n::name>(RepositoryName("fake")))));
- std::tr1::shared_ptr<FakeInstalledRepository> fake_inst(new FakeInstalledRepository(&env, RepositoryName("fake_inst")));
+ std::tr1::shared_ptr<FakeInstalledRepository> fake_inst(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake_inst")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(1, fake);
env.package_database()->add_repository(2, fake_inst);
fake->add_version("cat", "pkg1", "1");
diff --git a/ruby/repository.cc b/ruby/repository.cc
index 30d674f..b27d7b9 100644
--- a/ruby/repository.cc
+++ b/ruby/repository.cc
@@ -694,7 +694,12 @@ namespace
rb_raise(rb_eArgError, "FakeInstalledRepository.new expects two arguments, but got %d", argc);
std::tr1::shared_ptr<Repository> * r = new std::tr1::shared_ptr<Repository>(new
- FakeInstalledRepository(value_to_environment(argv[0]).get(), RepositoryName(StringValuePtr(argv[1]))));
+ FakeInstalledRepository(make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(value_to_environment(argv[0]).get()),
+ value_for<n::name>(RepositoryName(StringValuePtr(argv[1]))),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::tr1::shared_ptr<Repository> >::free, r));
rb_obj_call_init(tdata, argc, argv);
return tdata;
diff --git a/src/clients/adjutrix/display_default_system_resolution.cc b/src/clients/adjutrix/display_default_system_resolution.cc
index 9176510..0d73204 100644
--- a/src/clients/adjutrix/display_default_system_resolution.cc
+++ b/src/clients/adjutrix/display_default_system_resolution.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009 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
@@ -29,6 +29,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/dep_list.hh>
#include <paludis/dep_list_exceptions.hh>
@@ -116,8 +117,13 @@ int do_display_default_system_resolution(NoConfigEnvironment & env)
if (env.default_destinations()->empty())
{
- std::tr1::shared_ptr<Repository> fake_destination(new FakeInstalledRepository(&env,
- RepositoryName("fake_destination")));
+ std::tr1::shared_ptr<Repository> fake_destination(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake_destination")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(1, fake_destination);
}
diff --git a/src/clients/adjutrix/what_needs_keywording.cc b/src/clients/adjutrix/what_needs_keywording.cc
index 93a461c..d69b889 100644
--- a/src/clients/adjutrix/what_needs_keywording.cc
+++ b/src/clients/adjutrix/what_needs_keywording.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 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
@@ -27,6 +27,7 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/dep_list_exceptions.hh>
#include <paludis/dep_list.hh>
@@ -59,8 +60,13 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
if (env.default_destinations()->empty())
{
- std::tr1::shared_ptr<Repository> fake_destination(new FakeInstalledRepository(&env,
- RepositoryName("fake_destination")));
+ std::tr1::shared_ptr<Repository> fake_destination(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake_destination")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
env.package_database()->add_repository(1, fake_destination);
}