aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories')
-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
11 files changed, 153 insertions, 27 deletions
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 28bdf8d11..f9ed7d565 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 52ae1ecfc..ab01c9a5e 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 41eb9a02a..bb3edceeb 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 4b2d93d68..a6499e945 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 4ac86be81..da06358ca 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 9969bd8b5..43f1e325a 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 ca9a5353e..4a7891264 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 e07076ca3..80afb5d3c 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 a566d3a7c..c61a0b88c 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 e9999f8f3..362d0da90 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 a61891399..90f5e31bc 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);