aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/virtuals
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-05-19 16:01:04 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-05-19 16:01:04 +0100
commitcc129190d549f69eccc67407946261544d538a91 (patch)
tree08f0ffe78b5c3f63dfc89d32dba1d828a5107dd0 /paludis/repositories/virtuals
parentb22056183d6a0e94e28e025c6bae6970979c26c0 (diff)
downloadpaludis-cc129190d549f69eccc67407946261544d538a91.tar.gz
paludis-cc129190d549f69eccc67407946261544d538a91.tar.xz
New improved NamedValue syntax
Diffstat (limited to 'paludis/repositories/virtuals')
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc16
-rw-r--r--paludis/repositories/virtuals/package_id.cc4
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc16
-rw-r--r--paludis/repositories/virtuals/virtuals_repository_TEST.cc38
4 files changed, 37 insertions, 37 deletions
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index be83fc9be..33cea8864 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -110,12 +110,12 @@ namespace
InstalledVirtualsRepository::InstalledVirtualsRepository(const Environment * const env,
const FSEntry & r) :
Repository(env, RepositoryName(make_name(r)), make_named_values<RepositoryCapabilities>(
- value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(this)),
- value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
- value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
- value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
- value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
+ n::destination_interface() = static_cast<RepositoryDestinationInterface *>(this),
+ n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
+ n::make_virtuals_interface() = static_cast<RepositoryMakeVirtualsInterface *>(0),
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0),
+ n::provides_interface() = static_cast<RepositoryProvidesInterface *>(0),
+ n::virtuals_interface() = static_cast<RepositoryVirtualsInterface *>(0)
)),
PrivateImplementationPattern<InstalledVirtualsRepository>(
new Implementation<InstalledVirtualsRepository>(env, r)),
@@ -237,7 +237,7 @@ InstalledVirtualsRepository::perform_hook(const Hook & hook)
Context context("When performing hook '" + stringify(hook.name()) + "' for repository '"
+ stringify(name()) + "':");
- return make_named_values<HookResult>(value_for<n::max_exit_status>(0), value_for<n::output>(""));
+ return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
bool
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index 25781e80c..53433f180 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -71,8 +71,8 @@ namespace paludis
make_package_dep_spec(PartiallyMadePackageDepSpecOptions())
.package(v->name())
.version_requirement(make_named_values<VersionRequirement>(
- value_for<n::version_operator>(vo_equal),
- value_for<n::version_spec>(v->version())))
+ n::version_operator() = vo_equal,
+ n::version_spec() = v->version()))
.slot_requirement(make_shared_ptr(new UserSlotExactRequirement(
v->slot_key() ? v->slot_key()->value() : SlotName("UNKNOWN"))))
.in_repository(v->repository()->name())))
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index fcfb89eca..c26a33878 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -122,12 +122,12 @@ namespace
VirtualsRepository::VirtualsRepository(const Environment * const env) :
Repository(env, RepositoryName("virtuals"), make_named_values<RepositoryCapabilities>(
- value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
- value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
- value_for<n::make_virtuals_interface>(this),
- value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
- value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
+ n::destination_interface() = static_cast<RepositoryDestinationInterface *>(0),
+ n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
+ n::make_virtuals_interface() = this,
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0),
+ n::provides_interface() = static_cast<RepositoryProvidesInterface *>(0),
+ n::virtuals_interface() = static_cast<RepositoryVirtualsInterface *>(0)
)),
PrivateImplementationPattern<VirtualsRepository>(
new Implementation<VirtualsRepository>(env)),
@@ -463,7 +463,7 @@ VirtualsRepository::populate_sets() const
HookResult
VirtualsRepository::perform_hook(const Hook &)
{
- return make_named_values<HookResult>(value_for<n::max_exit_status>(0), value_for<n::output>(""));
+ return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
bool
diff --git a/paludis/repositories/virtuals/virtuals_repository_TEST.cc b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
index 90f5e31bc..a93565266 100644
--- a/paludis/repositories/virtuals/virtuals_repository_TEST.cc
+++ b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -52,15 +52,15 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<VirtualsRepository> virtuals(new VirtualsRepository(&env));
const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
- value_for<n::environment>(&env),
- value_for<n::name>(RepositoryName("repo"))
+ n::environment() = &env,
+ n::name() = RepositoryName("repo")
)));
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)
+ n::environment() = &env,
+ n::name() = RepositoryName("installed"),
+ n::suitable_destination() = true,
+ n::supports_uninstall() = true
)));
TEST_CHECK(repo->virtuals_interface());
@@ -95,19 +95,19 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<VirtualsRepository> virtuals(new VirtualsRepository(&env));
const std::tr1::shared_ptr<FakeRepository> repo1(new FakeRepository(make_named_values<FakeRepositoryParams>(
- value_for<n::environment>(&env),
- value_for<n::name>(RepositoryName("repo1"))
+ n::environment() = &env,
+ n::name() = RepositoryName("repo1")
)));
const std::tr1::shared_ptr<FakeRepository> repo2(new FakeRepository(make_named_values<FakeRepositoryParams>(
- value_for<n::environment>(&env),
- value_for<n::name>(RepositoryName("repo2"))
+ n::environment() = &env,
+ n::name() = RepositoryName("repo2")
)));
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)
+ n::environment() = &env,
+ n::name() = RepositoryName("installed"),
+ n::suitable_destination() = true,
+ n::supports_uninstall() = true
)));
env.package_database()->add_repository(2, virtuals);
@@ -148,12 +148,12 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<VirtualsRepository> virtuals(new VirtualsRepository(&env));
const std::tr1::shared_ptr<FakeRepository> repo1(new FakeRepository(make_named_values<FakeRepositoryParams>(
- value_for<n::environment>(&env),
- value_for<n::name>(RepositoryName("repo1"))
+ n::environment() = &env,
+ n::name() = RepositoryName("repo1")
)));
const std::tr1::shared_ptr<FakeRepository> repo2(new FakeRepository(make_named_values<FakeRepositoryParams>(
- value_for<n::environment>(&env),
- value_for<n::name>(RepositoryName("repo2"))
+ n::environment() = &env,
+ n::name() = RepositoryName("repo2")
)));
env.package_database()->add_repository(2, repo1);