aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-02-21 14:40:19 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-02-21 14:40:19 +0000
commit981dd553a590eff046d49bccd06f2cb61963edee (patch)
tree5ffceeda6cfaa575b92ca48e1152997bbded3605 /paludis/repositories
parent690aca7a8de4bf9b682be59abbed08a8d12a21d8 (diff)
downloadpaludis-981dd553a590eff046d49bccd06f2cb61963edee.tar.gz
paludis-981dd553a590eff046d49bccd06f2cb61963edee.tar.xz
More sr -> kc
Diffstat (limited to 'paludis/repositories')
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc36
-rw-r--r--paludis/repositories/cran/cran_repository.cc30
-rw-r--r--paludis/repositories/e/conditional_dep_spec.cc2
-rw-r--r--paludis/repositories/e/e_installed_repository.cc13
-rw-r--r--paludis/repositories/e/e_key.cc24
-rw-r--r--paludis/repositories/e/e_repository.cc64
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc20
-rw-r--r--paludis/repositories/e/e_repository_sets_TEST.cc8
-rw-r--r--paludis/repositories/e/ebuild_entries.cc35
-rw-r--r--paludis/repositories/e/exndbam_repository.cc56
-rw-r--r--paludis/repositories/e/qa/fetches_key.cc2
-rw-r--r--paludis/repositories/e/qa/iuse_key.cc4
-rw-r--r--paludis/repositories/e/qa/spec_keys.cc6
-rw-r--r--paludis/repositories/e/qa/visibility.cc19
-rw-r--r--paludis/repositories/e/source_uri_finder.cc14
-rw-r--r--paludis/repositories/e/vdb_repository.cc68
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc18
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc36
-rw-r--r--paludis/repositories/fake/fake_package_id.cc8
-rw-r--r--paludis/repositories/fake/fake_repository.cc60
-rw-r--r--paludis/repositories/gems/gems_repository.cc30
-rw-r--r--paludis/repositories/gems/installed_gems_repository.cc30
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc64
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc14
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.cc30
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc40
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc46
-rw-r--r--paludis/repositories/virtuals/virtuals_repository_TEST.cc4
28 files changed, 392 insertions, 389 deletions
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index 2e8db04b8..8c8dd4292 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -153,21 +153,21 @@ Implementation<CRANInstalledRepository>::need_ids() const
CRANInstalledRepository::CRANInstalledRepository(const CRANInstalledRepositoryParams & p) :
Repository(RepositoryName("installed-cran"),
- RepositoryCapabilities::create()
- .sets_interface(this)
- .syncable_interface(0)
- .use_interface(0)
- .world_interface(this)
- .environment_variable_interface(0)
- .mirrors_interface(0)
- .virtuals_interface(0)
- .provides_interface(0)
- .destination_interface(this)
- .e_interface(0)
- .qa_interface(0)
- .make_virtuals_interface(0)
- .hook_interface(0)
- .manifest_interface(0)),
+ RepositoryCapabilities::named_create()
+ (k::sets_interface(), this)
+ (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
+ (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
+ (k::world_interface(), this)
+ (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
+ (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
+ (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
+ (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
+ (k::destination_interface(), this)
+ (k::e_interface(), static_cast<RepositoryEInterface *>(0))
+ (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
+ (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
+ (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
+ (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
PrivateImplementationPattern<CRANInstalledRepository>(new Implementation<CRANInstalledRepository>(p)),
_imp(PrivateImplementationPattern<CRANInstalledRepository>::_imp)
{
@@ -597,11 +597,11 @@ CRANInstalledRepository::want_pre_post_phases() const
void
CRANInstalledRepository::merge(const MergeParams & m)
{
- Context context("When merging '" + stringify(*m.package_id) + "' at '" + stringify(m.image_dir)
+ Context context("When merging '" + stringify(*m[k::package_id()]) + "' at '" + stringify(m[k::image_dir()])
+ "' to repository '" + stringify(name()) + "':");
- if (! is_suitable_destination_for(*m.package_id))
- throw InstallActionError("Not a suitable destination for '" + stringify(*m.package_id) + "'");
+ if (! is_suitable_destination_for(*m[k::package_id()]))
+ throw InstallActionError("Not a suitable destination for '" + stringify(*m[k::package_id()]) + "'");
}
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index 28ade0566..a86d6aa84 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -99,21 +99,21 @@ Implementation<CRANRepository>::~Implementation()
CRANRepository::CRANRepository(const CRANRepositoryParams & p) :
Repository(CRANRepository::fetch_repo_name(stringify(p.location)),
- RepositoryCapabilities::create()
- .sets_interface(this)
- .syncable_interface(this)
- .use_interface(0)
- .world_interface(0)
- .environment_variable_interface(0)
- .make_virtuals_interface(0)
- .mirrors_interface(0)
- .provides_interface(0)
- .destination_interface(0)
- .virtuals_interface(0)
- .e_interface(0)
- .qa_interface(0)
- .hook_interface(0)
- .manifest_interface(0)),
+ RepositoryCapabilities::named_create()
+ (k::sets_interface(), this)
+ (k::syncable_interface(), this)
+ (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
+ (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
+ (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
+ (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
+ (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
+ (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
+ (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
+ (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
+ (k::e_interface(), static_cast<RepositoryEInterface *>(0))
+ (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
+ (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
+ (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
PrivateImplementationPattern<CRANRepository>(new Implementation<CRANRepository>(p, make_shared_ptr(new Mutex))),
_imp(PrivateImplementationPattern<CRANRepository>::_imp)
{
diff --git a/paludis/repositories/e/conditional_dep_spec.cc b/paludis/repositories/e/conditional_dep_spec.cc
index 3ec276f63..48f58bad8 100644
--- a/paludis/repositories/e/conditional_dep_spec.cc
+++ b/paludis/repositories/e/conditional_dep_spec.cc
@@ -89,7 +89,7 @@ namespace
if (! id)
throw InternalError(PALUDIS_HERE, "! id");
- RepositoryUseInterface * const u(id->repository()->use_interface);
+ RepositoryUseInterface * const u((*id->repository())[k::use_interface()]);
if (! u)
return true;
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index 3bcceb0cb..8fedae814 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -486,13 +486,14 @@ EInstalledRepository::perform_info(const tr1::shared_ptr<const ERepositoryID> &
if (_imp->params.environment->package_database()->has_repository_named(rn))
{
const tr1::shared_ptr<const Repository> r(_imp->params.environment->package_database()->fetch_repository(rn));
- if (r->e_interface)
+ if ((*r)[k::e_interface()])
{
- i = r->e_interface->info_variables_file(r->e_interface->params().location / "profiles");
+ i = (*r)[k::e_interface()]->info_variables_file((*r)[k::e_interface()]->params().location / "profiles");
/* also try its master, if it has one */
- if ((! i.exists()) && r->e_interface->params().master_repository)
- i = r->e_interface->info_variables_file(r->e_interface->params().master_repository->params().location / "profiles");
+ if ((! i.exists()) && (*r)[k::e_interface()]->params().master_repository)
+ i = (*r)[k::e_interface()]->info_variables_file(
+ (*r)[k::e_interface()]->params().master_repository->params().location / "profiles");
}
}
}
@@ -504,10 +505,10 @@ EInstalledRepository::perform_info(const tr1::shared_ptr<const ERepositoryID> &
r_end(_imp->params.environment->package_database()->end_repositories()) ;
r != r_end ; ++r)
{
- if (! (*r)->e_interface)
+ if (! (**r)[k::e_interface()])
continue;
- i = (*r)->e_interface->info_variables_file((*r)->e_interface->params().location / "profiles");
+ i = (**r)[k::e_interface()]->info_variables_file((**r)[k::e_interface()]->params().location / "profiles");
if (i.exists())
break;
}
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index b8d74c586..ac35165b9 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -578,8 +578,8 @@ EIUseKey::value() const
tokenise_whitespace(_imp->string_value, std::back_inserter(tokens));
tr1::shared_ptr<const UseFlagNameSet> prefixes;
- if (_imp->id->repository()->use_interface)
- prefixes = _imp->id->repository()->use_interface->use_expand_prefixes();
+ if ((*_imp->id->repository())[k::use_interface()])
+ prefixes = (*_imp->id->repository())[k::use_interface()]->use_expand_prefixes();
else
prefixes.reset(new UseFlagNameSet);
@@ -614,9 +614,9 @@ EIUseKey::pretty_print_flat(const Formatter<IUseFlag> & f) const
if (! result.empty())
result.append(" ");
- if (_imp->id->repository()->use_interface && _imp->id->repository()->use_interface->query_use_mask(i->flag, *_imp->id))
+ if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_mask(i->flag, *_imp->id))
result.append(f.format(*i, format::Masked()));
- else if (_imp->id->repository()->use_interface && _imp->id->repository()->use_interface->query_use_force(i->flag, *_imp->id))
+ else if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_force(i->flag, *_imp->id))
result.append(f.format(*i, format::Forced()));
else if (_imp->env->query_use(i->flag, *_imp->id))
result.append(f.format(*i, format::Enabled()));
@@ -630,9 +630,9 @@ EIUseKey::pretty_print_flat(const Formatter<IUseFlag> & f) const
if (! result.empty())
result.append(" ");
- if (_imp->id->repository()->use_interface && _imp->id->repository()->use_interface->query_use_mask(j->second.flag, *_imp->id))
+ if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_mask(j->second.flag, *_imp->id))
result.append(f.format(j->second, format::Masked()));
- else if (_imp->id->repository()->use_interface && _imp->id->repository()->use_interface->query_use_force(j->second.flag, *_imp->id))
+ else if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_force(j->second.flag, *_imp->id))
result.append(f.format(j->second, format::Forced()));
else if (_imp->env->query_use(j->second.flag, *_imp->id))
result.append(f.format(j->second, format::Enabled()));
@@ -666,12 +666,12 @@ EIUseKey::pretty_print_flat_with_comparison(
std::string l;
bool n;
- if (_imp->id->repository()->use_interface && _imp->id->repository()->use_interface->query_use_mask(i->flag, *_imp->id))
+ if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_mask(i->flag, *_imp->id))
{
l = f.format(*i, format::Masked());
n = false;
}
- else if (_imp->id->repository()->use_interface && _imp->id->repository()->use_interface->query_use_force(i->flag, *_imp->id))
+ else if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_force(i->flag, *_imp->id))
{
l = f.format(*i, format::Forced());
n = true;
@@ -713,12 +713,12 @@ EIUseKey::pretty_print_flat_with_comparison(
std::string l;
bool n;
- if (_imp->id->repository()->use_interface && _imp->id->repository()->use_interface->query_use_mask(j->second.flag, *_imp->id))
+ if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_mask(j->second.flag, *_imp->id))
{
l = f.format(j->second, format::Masked());
n = false;
}
- else if (_imp->id->repository()->use_interface && _imp->id->repository()->use_interface->query_use_force(j->second.flag, *_imp->id))
+ else if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_force(j->second.flag, *_imp->id))
{
l = f.format(j->second, format::Forced());
n = true;
@@ -889,9 +889,9 @@ EUseKey::pretty_print_flat(const Formatter<UseFlagName> & f) const
if (! result.empty())
result.append(" ");
- if (_imp->id->repository()->use_interface && _imp->id->repository()->use_interface->query_use_mask(*i, *_imp->id))
+ if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_mask(*i, *_imp->id))
result.append(f.format(*i, format::Masked()));
- else if (_imp->id->repository()->use_interface && _imp->id->repository()->use_interface->query_use_force(*i, *_imp->id))
+ else if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_force(*i, *_imp->id))
result.append(f.format(*i, format::Forced()));
else if (_imp->env->query_use(*i, *_imp->id))
result.append(f.format(*i, format::Enabled()));
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index e444f386b..a194c868d 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -394,11 +394,11 @@ namespace paludis
FSEntrySequence profiles;
profiles.push_back(layout->profiles_base_dir() / tokens.at(1));
- profiles_desc.push_back(RepositoryEInterface::ProfilesDescLine::create()
- .arch(tokens.at(0))
- .path(*profiles.begin())
- .status(tokens.at(2))
- .profile(tr1::shared_ptr<ERepositoryProfile>(new ERepositoryProfile(
+ profiles_desc.push_back(RepositoryEInterface::ProfilesDescLine::named_create()
+ (k::arch(), tokens.at(0))
+ (k::path(), *profiles.begin())
+ (k::status(), tokens.at(2))
+ (k::profile(), tr1::shared_ptr<ERepositoryProfile>(new ERepositoryProfile(
params.environment, repo, repo->name(), profiles,
erepository::EAPIData::get_instance()->eapi_from_string(
params.eapi_when_unknown)->supported->ebuild_environment_variables->env_arch))));
@@ -452,26 +452,26 @@ namespace
ERepository::ERepository(const ERepositoryParams & p) :
Repository(fetch_repo_name(p.location),
- RepositoryCapabilities::create()
- .sets_interface(this)
- .syncable_interface(this)
- .use_interface(this)
- .world_interface(0)
- .environment_variable_interface(this)
- .mirrors_interface(this)
- .virtuals_interface((*DistributionData::get_instance()->distribution_from_string(
+ RepositoryCapabilities::named_create()
+ (k::sets_interface(), this)
+ (k::syncable_interface(), this)
+ (k::use_interface(), this)
+ (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
+ (k::environment_variable_interface(), this)
+ (k::mirrors_interface(), this)
+ (k::virtuals_interface(), (*DistributionData::get_instance()->distribution_from_string(
p.environment->default_distribution()))[k::support_old_style_virtuals()] ? this : 0)
- .provides_interface(0)
- .destination_interface(p.binary_destination ? this : 0)
- .make_virtuals_interface(0)
- .e_interface(this)
+ (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
+ (k::destination_interface(), p.binary_destination ? this : 0)
+ (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
+ (k::e_interface(), this)
#ifdef ENABLE_QA
- .qa_interface(this)
+ (k::qa_interface(), this)
#else
- .qa_interface(0)
+ (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
#endif
- .hook_interface(this)
- .manifest_interface(this)),
+ (k::hook_interface(), this)
+ (k::manifest_interface(), this)),
PrivateImplementationPattern<ERepository>(new Implementation<ERepository>(this, p)),
_imp(PrivateImplementationPattern<ERepository>::_imp)
{
@@ -780,10 +780,10 @@ ERepository::sync() const
for (std::list<std::string>::const_iterator s(sync_list.begin()),
s_end(sync_list.end()) ; s != s_end ; ++s)
{
- DefaultSyncer syncer(SyncerParams::create()
- .environment(_imp->params.environment)
- .local(stringify(_imp->params.location))
- .remote(*s)
+ DefaultSyncer syncer(SyncerParams::named_create()
+ (k::environment(), _imp->params.environment)
+ (k::local(), stringify(_imp->params.location))
+ (k::remote(), *s)
);
SyncOptions opts(
_imp->params.sync_options,
@@ -906,9 +906,9 @@ ERepository::virtual_packages() const
for (ERepositoryProfile::VirtualsConstIterator i(_imp->profile_ptr->begin_virtuals()),
i_end(_imp->profile_ptr->end_virtuals()) ; i != i_end ; ++i)
- result->push_back(RepositoryVirtualsEntry::create()
- .provided_by_spec(i->second)
- .virtual_name(i->first));
+ result->push_back(RepositoryVirtualsEntry::named_create()
+ (k::provided_by_spec(), i->second)
+ (k::virtual_name(), i->first));
return result;
}
@@ -1020,7 +1020,7 @@ ERepository::find_profile(const FSEntry & location) const
_imp->need_profiles_desc();
for (ProfilesDesc::const_iterator i(_imp->profiles_desc.begin()),
i_end(_imp->profiles_desc.end()) ; i != i_end ; ++i)
- if (i->path == location)
+ if ((*i)[k::path()] == location)
return ProfilesConstIterator(i);
return ProfilesConstIterator(_imp->profiles_desc.end());
}
@@ -1030,7 +1030,7 @@ ERepository::set_profile(const ProfilesConstIterator & iter)
{
Context context("When setting profile by iterator:");
- _imp->profile_ptr = iter->profile;
+ _imp->profile_ptr = (*iter)[k::profile()];
if ((*DistributionData::get_instance()->distribution_from_string(_imp->params.environment->default_distribution()))
[k::support_old_style_virtuals()])
@@ -1047,14 +1047,14 @@ ERepository::set_profile_by_arch(const UseFlagName & arch)
Context context("When setting profile by arch '" + stringify(arch) + "':");
for (ProfilesConstIterator p(begin_profiles()), p_end(end_profiles()) ; p != p_end ; ++p)
- if (p->arch == stringify(arch) && p->status == "stable")
+ if ((*p)[k::arch()] == stringify(arch) && (*p)[k::status()] == "stable")
{
set_profile(p);
return;
}
for (ProfilesConstIterator p(begin_profiles()), p_end(end_profiles()) ; p != p_end ; ++p)
- if (p->arch == stringify(arch))
+ if ((*p)[k::arch()] == stringify(arch))
{
set_profile(p);
return;
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 2c2a8655d..62afe1851 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -803,16 +803,16 @@ namespace test_cases
tr1::shared_ptr<const RepositoryVirtualsInterface::VirtualsSequence> seq(repo->virtual_packages());
for (RepositoryVirtualsInterface::VirtualsSequence::ConstIterator it(seq->begin()),
it_end(seq->end()); it_end != it; ++it, ++count)
- if ("virtual/one" == stringify(it->virtual_name))
+ if ("virtual/one" == stringify((*it)[k::virtual_name()]))
{
has_one = true;
- TEST_CHECK_STRINGIFY_EQUAL(*it->provided_by_spec, "cat-one/pkg-one");
+ TEST_CHECK_STRINGIFY_EQUAL(*(*it)[k::provided_by_spec()], "cat-one/pkg-one");
}
else
{
- TEST_CHECK_STRINGIFY_EQUAL(it->virtual_name, "virtual/two");
+ TEST_CHECK_STRINGIFY_EQUAL((*it)[k::virtual_name()], "virtual/two");
has_two = true;
- TEST_CHECK_STRINGIFY_EQUAL(*it->provided_by_spec, "cat-two/pkg-two");
+ TEST_CHECK_STRINGIFY_EQUAL(*(*it)[k::provided_by_spec()], "cat-two/pkg-two");
}
TEST_CHECK(has_one);
@@ -827,21 +827,21 @@ namespace test_cases
seq = repo->virtual_packages();
for (RepositoryVirtualsInterface::VirtualsSequence::ConstIterator it(seq->begin()),
it_end(seq->end()); it_end != it; ++it, ++count)
- if ("virtual/one" == stringify(it->virtual_name))
+ if ("virtual/one" == stringify((*it)[k::virtual_name()]))
{
has_one = true;
- TEST_CHECK_STRINGIFY_EQUAL(*it->provided_by_spec, "cat-two/pkg-two");
+ TEST_CHECK_STRINGIFY_EQUAL(*(*it)[k::provided_by_spec()], "cat-two/pkg-two");
}
- else if ("virtual/two" == stringify(it->virtual_name))
+ else if ("virtual/two" == stringify((*it)[k::virtual_name()]))
{
has_two = true;
- TEST_CHECK_STRINGIFY_EQUAL(*it->provided_by_spec, "cat-one/pkg-one");
+ TEST_CHECK_STRINGIFY_EQUAL(*(*it)[k::provided_by_spec()], "cat-one/pkg-one");
}
else
{
- TEST_CHECK_STRINGIFY_EQUAL(it->virtual_name, "virtual/three");
+ TEST_CHECK_STRINGIFY_EQUAL((*it)[k::virtual_name()], "virtual/three");
has_three = true;
- TEST_CHECK_STRINGIFY_EQUAL(*it->provided_by_spec, "cat-three/pkg-three");
+ TEST_CHECK_STRINGIFY_EQUAL(*(*it)[k::provided_by_spec()], "cat-three/pkg-three");
}
TEST_CHECK(has_one);
diff --git a/paludis/repositories/e/e_repository_sets_TEST.cc b/paludis/repositories/e/e_repository_sets_TEST.cc
index f9cc03951..8eac4978d 100644
--- a/paludis/repositories/e/e_repository_sets_TEST.cc
+++ b/paludis/repositories/e/e_repository_sets_TEST.cc
@@ -61,7 +61,7 @@ namespace test_cases
tr1::shared_ptr<ERepository> repo(make_ebuild_repository(
&env, keys));
- tr1::shared_ptr<const SetNameSet> sets_list(repo->sets_interface->sets_list());
+ tr1::shared_ptr<const SetNameSet> sets_list((*repo)[k::sets_interface()]->sets_list());
TEST_CHECK_EQUAL(sets_list->size(), 4U);
TEST_CHECK(sets_list->end() != sets_list->find(SetName("system")));
TEST_CHECK(sets_list->end() != sets_list->find(SetName("security")));
@@ -94,7 +94,7 @@ namespace test_cases
installed->add_version("cat-two", "bar", "1.5");
env.package_database()->add_repository(0, installed);
- tr1::shared_ptr<SetSpecTree::ConstItem> set1(repo->sets_interface->package_set(SetName("set1")));
+ tr1::shared_ptr<SetSpecTree::ConstItem> set1((*repo)[k::sets_interface()]->package_set(SetName("set1")));
StringifyFormatter ff;
erepository::DepSpecPrettyPrinter pretty(0, tr1::shared_ptr<const PackageID>(), ff, 0, false);
set1->accept(pretty);
@@ -129,7 +129,7 @@ namespace test_cases
&env, keys));
env.package_database()->add_repository(1, repo);
- tr1::shared_ptr<SetSpecTree::ConstItem> insecurity(repo->sets_interface->package_set(SetName("insecurity")));
+ tr1::shared_ptr<SetSpecTree::ConstItem> insecurity((*repo)[k::sets_interface()]->package_set(SetName("insecurity")));
StringifyFormatter ff;
erepository::DepSpecPrettyPrinter pretty(0, tr1::shared_ptr<const PackageID>(), ff, 0, false);
insecurity->accept(pretty);
@@ -171,7 +171,7 @@ namespace test_cases
installed->add_version("cat-three", "baz", "1.0");
env.package_database()->add_repository(0, installed);
- tr1::shared_ptr<const SetSpecTree::ConstItem> security(repo->sets_interface->package_set(SetName("security")));
+ tr1::shared_ptr<const SetSpecTree::ConstItem> security((*repo)[k::sets_interface()]->package_set(SetName("security")));
StringifyFormatter ff;
erepository::DepSpecPrettyPrinter pretty(0, tr1::shared_ptr<const PackageID>(), ff, 0, false);
security->accept(pretty);
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index d219337d2..e75221896 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -535,23 +535,24 @@ EbuildEntries::install(const tr1::shared_ptr<const ERepositoryID> & id,
{
if (phase->option("merge"))
{
- if (! o[k::destination()]->destination_interface)
+ if (! (*o[k::destination()])[k::destination_interface()])
throw InstallActionError("Can't install '" + stringify(*id)
+ "' to destination '" + stringify(o[k::destination()]->name())
+ "' because destination does not provide destination_interface");
- o[k::destination()]->destination_interface->merge(
- MergeParams::create()
- .package_id(id)
- .image_dir(_imp->params.builddir / stringify(id->name().category) / (stringify(id->name().package) + "-"
+ (*o[k::destination()])[k::destination_interface()]->merge(
+ MergeParams::named_create()
+ (k::package_id(), id)
+ (k::image_dir(), _imp->params.builddir / stringify(id->name().category) / (stringify(id->name().package) + "-"
+ stringify(id->version())) / "image")
- .environment_file(_imp->params.builddir / stringify(id->name().category) / (stringify(id->name().package) + "-"
+ (k::environment_file(), _imp->params.builddir / stringify(id->name().category) / (stringify(id->name().package) + "-"
+ stringify(id->version())) / "temp" / "loadsaveenv")
- .options(id->eapi()->supported->merger_options)
+ (k::options(), id->eapi()->supported->merger_options)
);
}
else if ((! phase->option("prepost")) ||
- (o[k::destination()]->destination_interface && o[k::destination()]->destination_interface->want_pre_post_phases()))
+ ((*o[k::destination()])[k::destination_interface()] &&
+ (*o[k::destination()])[k::destination_interface()]->want_pre_post_phases()))
{
if (phase->option("checkphase"))
{
@@ -728,15 +729,15 @@ EbuildEntries::make_ebuild_entries(
void
EbuildEntries::merge(const MergeParams & m)
{
- Context context("When merging '" + stringify(*m.package_id) + "' at '" + stringify(m.image_dir)
+ Context context("When merging '" + stringify(*m[k::package_id()]) + "' at '" + stringify(m[k::image_dir()])
+ "' to E repository '" + stringify(_imp->e_repository->name()) + "':");
- if (! _imp->e_repository->is_suitable_destination_for(*m.package_id))
- throw InstallActionError("Not a suitable destination for '" + stringify(*m.package_id) + "'");
+ if (! _imp->e_repository->is_suitable_destination_for(*m[k::package_id()]))
+ throw InstallActionError("Not a suitable destination for '" + stringify(*m[k::package_id()]) + "'");
FSEntry binary_ebuild_location(_imp->e_repository->layout()->binary_ebuild_location(
- m.package_id->name(), m.package_id->version(),
- "pbin-1+" + tr1::static_pointer_cast<const ERepositoryID>(m.package_id)->eapi()->name));
+ m[k::package_id()]->name(), m[k::package_id()]->version(),
+ "pbin-1+" + tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()])->eapi()->name));
binary_ebuild_location.dirname().dirname().mkdir();
binary_ebuild_location.dirname().mkdir();
@@ -744,14 +745,14 @@ EbuildEntries::merge(const MergeParams & m)
WriteBinaryEbuildCommand write_binary_ebuild_command(
WriteBinaryEbuildCommandParams::create()
.environment(_imp->params.environment)
- .package_id(tr1::static_pointer_cast<const ERepositoryID>(m.package_id))
+ .package_id(tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()]))
.binary_ebuild_location(binary_ebuild_location)
.binary_distdir(_imp->params.binary_distdir)
- .environment_file(m.environment_file)
- .image(m.image_dir)
+ .environment_file(m[k::environment_file()])
+ .image(m[k::image_dir()])
.destination_repository(_imp->e_repository)
.builddir(_imp->params.builddir)
- .merger_options(tr1::static_pointer_cast<const ERepositoryID>(m.package_id)
+ .merger_options(tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()])
->eapi()->supported->merger_options));
write_binary_ebuild_command();
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index f62eb5295..7d62b1bcb 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -97,21 +97,21 @@ ExndbamRepository::ExndbamRepository(const RepositoryName & n, const ExndbamRepo
.world(p.world)
.builddir(p.builddir)
.root(p.root),
- n, RepositoryCapabilities::create()
- .sets_interface(this)
- .syncable_interface(0)
- .use_interface(this)
- .world_interface(this)
- .environment_variable_interface(this)
- .mirrors_interface(0)
- .provides_interface(0)
- .virtuals_interface(0)
- .destination_interface(this)
- .e_interface(0)
- .make_virtuals_interface(0)
- .qa_interface(0)
- .hook_interface(this)
- .manifest_interface(0)),
+ n, RepositoryCapabilities::named_create()
+ (k::sets_interface(), this)
+ (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
+ (k::use_interface(), this)
+ (k::world_interface(), this)
+ (k::environment_variable_interface(), this)
+ (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
+ (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
+ (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
+ (k::destination_interface(), this)
+ (k::e_interface(), static_cast<RepositoryEInterface *>(0))
+ (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
+ (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
+ (k::hook_interface(), this)
+ (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
PrivateImplementationPattern<ExndbamRepository>(new Implementation<ExndbamRepository>(p)),
_imp(PrivateImplementationPattern<ExndbamRepository>::_imp)
{
@@ -266,20 +266,20 @@ ExndbamRepository::need_keys_added() const
void
ExndbamRepository::merge(const MergeParams & m)
{
- Context context("When merging '" + stringify(*m.package_id) + "' at '" + stringify(m.image_dir)
+ Context context("When merging '" + stringify(*m[k::package_id()]) + "' at '" + stringify(m[k::image_dir()])
+ "' to Exndbam repository '" + stringify(name()) + "':");
- if (! is_suitable_destination_for(*m.package_id))
- throw InstallActionError("Not a suitable destination for '" + stringify(*m.package_id) + "'");
+ if (! is_suitable_destination_for(*m[k::package_id()]))
+ throw InstallActionError("Not a suitable destination for '" + stringify(*m[k::package_id()]) + "'");
tr1::shared_ptr<const PackageID> if_overwritten_id, if_same_name_id;
{
- tr1::shared_ptr<const PackageIDSequence> ids(package_ids(m.package_id->name()));
+ tr1::shared_ptr<const PackageIDSequence> ids(package_ids(m[k::package_id()]->name()));
for (PackageIDSequence::ConstIterator v(ids->begin()), v_end(ids->end()) ;
v != v_end ; ++v)
{
if_same_name_id = *v;
- if ((*v)->version() == m.package_id->version() && (*v)->slot() == m.package_id->slot())
+ if ((*v)->version() == m[k::package_id()]->version() && (*v)->slot() == m[k::package_id()]->slot())
{
if_overwritten_id = *v;
break;
@@ -292,7 +292,7 @@ ExndbamRepository::merge(const MergeParams & m)
uid_dir = if_same_name_id->fs_location_key()->value().dirname();
else
{
- std::string uid(stringify(m.package_id->name().category) + "---" + stringify(m.package_id->name().package));
+ std::string uid(stringify(m[k::package_id()]->name().category) + "---" + stringify(m[k::package_id()]->name().package));
uid_dir /= "data";
uid_dir.mkdir();
uid_dir /= uid;
@@ -300,7 +300,7 @@ ExndbamRepository::merge(const MergeParams & m)
}
FSEntry target_ver_dir(uid_dir);
- target_ver_dir /= (stringify(m.package_id->version()) + ":" + stringify(m.package_id->slot()) + ":" + cookie());
+ target_ver_dir /= (stringify(m[k::package_id()]->version()) + ":" + stringify(m[k::package_id()]->slot()) + ":" + cookie());
if (target_ver_dir.exists())
throw InstallActionError("Temporary merge directory '" + stringify(target_ver_dir) + "' already exists, probably "
@@ -310,9 +310,9 @@ ExndbamRepository::merge(const MergeParams & m)
WriteVDBEntryCommand write_vdb_entry_command(
WriteVDBEntryParams::create()
.environment(_imp->params.environment)
- .package_id(tr1::static_pointer_cast<const ERepositoryID>(m.package_id))
+ .package_id(tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()]))
.output_directory(target_ver_dir)
- .environment_file(m.environment_file));
+ .environment_file(m[k::environment_file()]));
write_vdb_entry_command();
@@ -329,13 +329,13 @@ ExndbamRepository::merge(const MergeParams & m)
NDBAMMerger merger(
NDBAMMergerParams::create()
.environment(_imp->params.environment)
- .image(m.image_dir)
+ .image(m[k::image_dir()])
.root(installed_root_key()->value())
.contents_file(target_ver_dir / "contents")
.config_protect(config_protect)
.config_protect_mask(config_protect_mask)
- .package_id(m.package_id)
- .options(m.options));
+ .package_id(m[k::package_id()])
+ .options(m[k::options()]));
if (! merger.check())
{
@@ -348,7 +348,7 @@ ExndbamRepository::merge(const MergeParams & m)
merger.merge();
- _imp->ndbam.index(m.package_id->name(), uid_dir.basename());
+ _imp->ndbam.index(m[k::package_id()]->name(), uid_dir.basename());
if (if_overwritten_id)
{
diff --git a/paludis/repositories/e/qa/fetches_key.cc b/paludis/repositories/e/qa/fetches_key.cc
index eae5aa660..cec9f7088 100644
--- a/paludis/repositories/e/qa/fetches_key.cc
+++ b/paludis/repositories/e/qa/fetches_key.cc
@@ -145,7 +145,7 @@ namespace
else
{
mirror_host.erase(pos);
- RepositoryMirrorsInterface * m(id->repository()->mirrors_interface);
+ RepositoryMirrorsInterface * m((*id->repository())[k::mirrors_interface()]);
if (! m->is_mirror(mirror_host))
reporter.message(QAMessage(entry, qaml_normal, name,
"Unknown mirror '" + mirror_host + "' for '" +
diff --git a/paludis/repositories/e/qa/iuse_key.cc b/paludis/repositories/e/qa/iuse_key.cc
index 93016c7e9..b0c1a2b7c 100644
--- a/paludis/repositories/e/qa/iuse_key.cc
+++ b/paludis/repositories/e/qa/iuse_key.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008 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
@@ -89,7 +89,7 @@ paludis::erepository::iuse_key_check(
.with_associated_id(id)
.with_associated_key(id, id->iuse_key()));
- if ("" == repo->use_interface->describe_use_flag(it->flag, *id))
+ if ("" == (*repo)[k::use_interface()]->describe_use_flag(it->flag, *id))
reporter.message(QAMessage(entry, qaml_minor, name,
"Flag '" + stringify(it->flag) + "' in '" + id->iuse_key()->raw_name() + "' has no description")
.with_associated_id(id)
diff --git a/paludis/repositories/e/qa/spec_keys.cc b/paludis/repositories/e/qa/spec_keys.cc
index ed931d8f5..1af579529 100644
--- a/paludis/repositories/e/qa/spec_keys.cc
+++ b/paludis/repositories/e/qa/spec_keys.cc
@@ -189,7 +189,7 @@ namespace
.with_associated_id(id)
.with_associated_key(id, key));
- if (id->repository()->use_interface->arch_flags()->count(conditional_dep_spec_flag(u)))
+ if ((*id->repository())[k::use_interface()]->arch_flags()->count(conditional_dep_spec_flag(u)))
{
if (forbid_arch_flags)
reporter.message(QAMessage(entry, qaml_normal, name,
@@ -208,14 +208,14 @@ namespace
if (iuse_flags.end() == iuse_flags.find(conditional_dep_spec_flag(u)))
{
std::tr1::shared_ptr<const UseFlagNameSet> c(
- id->repository()->use_interface->use_expand_hidden_prefixes());
+ (*id->repository())[k::use_interface()]->use_expand_hidden_prefixes());
std::string flag(stringify(conditional_dep_spec_flag(u)));
bool is_hidden(false);
for (UseFlagNameSet::ConstIterator i(c->begin()), i_end(c->end()) ;
i != i_end ; ++i)
{
- std::string prefix(stringify(*i) + id->repository()->use_interface->use_expand_separator(*id));
+ std::string prefix(stringify(*i) + (*id->repository())[k::use_interface()]->use_expand_separator(*id));
if (0 == flag.compare(0, prefix.length(), prefix))
{
is_hidden = true;
diff --git a/paludis/repositories/e/qa/visibility.cc b/paludis/repositories/e/qa/visibility.cc
index 83c2e8db1..586b2834a 100644
--- a/paludis/repositories/e/qa/visibility.cc
+++ b/paludis/repositories/e/qa/visibility.cc
@@ -114,8 +114,8 @@ namespace
/* rewrite virtuals to avoid problems later on */
if (p->package_ptr())
{
- ERepositoryProfile::VirtualsConstIterator v(profile->profile->find_virtual(*p->package_ptr()));
- if (profile->profile->end_virtuals() != v)
+ ERepositoryProfile::VirtualsConstIterator v((*profile)[k::profile()]->find_virtual(*p->package_ptr()));
+ if ((*profile)[k::profile()]->end_virtuals() != v)
{
PartiallyMadePackageDepSpec pp;
@@ -145,7 +145,8 @@ namespace
if (reporter)
reporter->message(QAMessage(entry, qaml_normal, name, "No packages matching '"
+ stringify(orig_p) + "' in dependencies key '" + stringify(key->raw_name()) + "' for profile '"
- + stringify(profile->path) + "' (" + stringify(profile->arch) + "." + stringify(profile->status)
+ + stringify((*profile)[k::path()]) + "' (" + stringify((*profile)[k::arch()]) + "."
+ + stringify((*profile)[k::status()])
+ (unstable ? ".unstable" : ".stable") + ")")
.with_associated_id(id)
.with_associated_key(id, key));
@@ -158,13 +159,13 @@ namespace
/* can't use the usual masked rules here, so this gets a bit complicated... */
if ((*i)->repository() == repo)
{
- if (repo->repository_masked(**i) || profile->profile->profile_masked(**i) || ! (*i)->keywords_key())
+ if (repo->repository_masked(**i) || (*profile)[k::profile()]->profile_masked(**i) || ! (*i)->keywords_key())
continue;
}
else if ((*i)->repository() == repo->params().master_repository)
{
if (repo->params().master_repository->repository_masked(**i) ||
- profile->profile->profile_masked(**i) || ! (*i)->keywords_key())
+ (*profile)[k::profile()]->profile_masked(**i) || ! (*i)->keywords_key())
continue;
}
else
@@ -191,7 +192,7 @@ namespace
if (reporter)
reporter->message(QAMessage(entry, qaml_normal, name, "No visible packages matching '"
+ stringify(orig_p) + "' in dependencies key '" + stringify(key->raw_name()) + "' for profile '"
- + stringify(profile->path) + "' (" + stringify(profile->arch) + "." + stringify(profile->status)
+ + stringify((*profile)[k::path()]) + "' (" + stringify((*profile)[k::arch()]) + "." + stringify((*profile)[k::status()])
+ (unstable ? ".unstable" : ".stable") + ")")
.with_associated_id(id)
.with_associated_key(id, key));
@@ -238,7 +239,7 @@ namespace
std::for_each(begin, end, accept_visitor(printer));
reporter->message(QAMessage(entry, qaml_normal, name, "No item in block '|| ( "
+ stringify(printer) + " )' visible for profile '"
- + stringify(profile->path) + "' (" + stringify(profile->arch) + "." + stringify(profile->status)
+ + stringify((*profile)[k::path()]) + "' (" + stringify((*profile)[k::arch()]) + "." + stringify((*profile)[k::status()])
+ (unstable ? ".unstable" : ".stable") + ")")
.with_associated_id(id)
.with_associated_key(id, key));
@@ -276,11 +277,11 @@ paludis::erepository::visibility_check(
for (ERepository::ProfilesConstIterator p(repo->begin_profiles()), p_end(repo->end_profiles()) ;
p != p_end ; ++p)
{
- if (p->profile->profile_masked(*id))
+ if ((*p)[k::profile()]->profile_masked(*id))
continue;
std::set<KeywordName> accepted_keywords, overlap;
- tokenise_whitespace(p->profile->environment_variable(
+ tokenise_whitespace((*p)[k::profile()]->environment_variable(
repo->accept_keywords_variable()), create_inserter<KeywordName>(std::inserter(accepted_keywords, accepted_keywords.begin())));
std::set_intersection(accepted_keywords.begin(), accepted_keywords.end(),
diff --git a/paludis/repositories/e/source_uri_finder.cc b/paludis/repositories/e/source_uri_finder.cc
index c0828999f..10b5c1c0f 100644
--- a/paludis/repositories/e/source_uri_finder.cc
+++ b/paludis/repositories/e/source_uri_finder.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -156,9 +156,9 @@ SourceURIFinder::add_mirrors()
{
Context local_context("When adding repository mirrors '" + _imp->mirrors_name + "':");
- if (_imp->repo->mirrors_interface)
- for (RepositoryMirrorsInterface::MirrorsConstIterator m(_imp->repo->mirrors_interface->begin_mirrors(_imp->mirrors_name)),
- m_end(_imp->repo->mirrors_interface->end_mirrors(_imp->mirrors_name)) ;
+ if ((*_imp->repo)[k::mirrors_interface()])
+ for (RepositoryMirrorsInterface::MirrorsConstIterator m((*_imp->repo)[k::mirrors_interface()]->begin_mirrors(_imp->mirrors_name)),
+ m_end((*_imp->repo)[k::mirrors_interface()]->end_mirrors(_imp->mirrors_name)) ;
m != m_end ; ++m)
{
Log::get_instance()->message(ll_debug, lc_context) << "Adding " << strip_trailing(m->second, "/") << "/" << _imp->filename;
@@ -195,9 +195,9 @@ SourceURIFinder::add_listed()
{
Context local_context("When adding from repository for listed mirror '" + mirror + "':");
- if (_imp->repo->mirrors_interface)
- for (RepositoryMirrorsInterface::MirrorsConstIterator m(_imp->repo->mirrors_interface->begin_mirrors(mirror)),
- m_end(_imp->repo->mirrors_interface->end_mirrors(mirror)) ;
+ if ((*_imp->repo)[k::mirrors_interface()])
+ for (RepositoryMirrorsInterface::MirrorsConstIterator m((*_imp->repo)[k::mirrors_interface()]->begin_mirrors(mirror)),
+ m_end((*_imp->repo)[k::mirrors_interface()]->end_mirrors(mirror)) ;
m != m_end ; ++m)
{
Log::get_instance()->message(ll_debug, lc_context) << "Adding " << strip_trailing(m->second, "/")
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 30066f315..f51a0d1b2 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -146,21 +146,21 @@ VDBRepository::VDBRepository(const VDBRepositoryParams & p) :
.builddir(p.builddir)
.world(p.world),
p.name,
- RepositoryCapabilities::create()
- .sets_interface(this)
- .syncable_interface(0)
- .use_interface(this)
- .world_interface(this)
- .environment_variable_interface(this)
- .mirrors_interface(0)
- .provides_interface(this)
- .virtuals_interface(0)
- .destination_interface(this)
- .e_interface(0)
- .make_virtuals_interface(0)
- .qa_interface(0)
- .hook_interface(this)
- .manifest_interface(0)),
+ RepositoryCapabilities::named_create()
+ (k::sets_interface(), this)
+ (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
+ (k::use_interface(), this)
+ (k::world_interface(), this)
+ (k::environment_variable_interface(), this)
+ (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
+ (k::provides_interface(), this)
+ (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
+ (k::destination_interface(), this)
+ (k::e_interface(), static_cast<RepositoryEInterface *>(0))
+ (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
+ (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
+ (k::hook_interface(), this)
+ (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
PrivateImplementationPattern<VDBRepository>(new Implementation<VDBRepository>(this, p)),
_imp(PrivateImplementationPattern<VDBRepository>::_imp)
{
@@ -537,9 +537,9 @@ VDBRepository::load_provided_using_cache() const
pp->accept(f);
for (DepSpecFlattener<ProvideSpecTree, PackageDepSpec>::ConstIterator p(f.begin()), p_end(f.end()) ; p != p_end ; ++p)
- result->push_back(RepositoryProvidesEntry::create()
- .virtual_name(QualifiedPackageName((*p)->text()))
- .provided_by(id));
+ result->push_back(RepositoryProvidesEntry::named_create()
+ (k::virtual_name(), QualifiedPackageName((*p)->text()))
+ (k::provided_by(), id));
}
_imp->provides = result;
@@ -592,9 +592,9 @@ VDBRepository::load_provided_the_slow_way() const
Log::get_instance()->message(ll_warning, lc_no_context, "PROVIDE of non-virtual '"
+ stringify(pp) + "' from '" + stringify(**e) + "' will not work as expected");
- result->push_back(RepositoryProvidesEntry::create()
- .virtual_name(pp)
- .provided_by(*e));
+ result->push_back(RepositoryProvidesEntry::named_create()
+ (k::virtual_name(), pp)
+ (k::provided_by(), *e));
}
}
catch (const InternalError &)
@@ -696,29 +696,29 @@ VDBRepository::category_names_containing_package(const PackageNamePart & p) cons
void
VDBRepository::merge(const MergeParams & m)
{
- Context context("When merging '" + stringify(*m.package_id) + "' at '" + stringify(m.image_dir)
+ Context context("When merging '" + stringify(*m[k::package_id()]) + "' at '" + stringify(m[k::image_dir()])
+ "' to VDB repository '" + stringify(name()) + "':");
- if (! is_suitable_destination_for(*m.package_id))
- throw InstallActionError("Not a suitable destination for '" + stringify(*m.package_id) + "'");
+ if (! is_suitable_destination_for(*m[k::package_id()]))
+ throw InstallActionError("Not a suitable destination for '" + stringify(*m[k::package_id()]) + "'");
- tr1::shared_ptr<const ERepositoryID> is_replace(package_id_if_exists(m.package_id->name(), m.package_id->version()));
+ tr1::shared_ptr<const ERepositoryID> is_replace(package_id_if_exists(m[k::package_id()]->name(), m[k::package_id()]->version()));
FSEntry tmp_vdb_dir(_imp->params.location);
if (! tmp_vdb_dir.exists())
tmp_vdb_dir.mkdir();
- tmp_vdb_dir /= stringify(m.package_id->name().category);
+ tmp_vdb_dir /= stringify(m[k::package_id()]->name().category);
if (! tmp_vdb_dir.exists())
tmp_vdb_dir.mkdir();
- tmp_vdb_dir /= ("-checking-" + stringify(m.package_id->name().package) + "-" + stringify(m.package_id->version()));
+ tmp_vdb_dir /= ("-checking-" + stringify(m[k::package_id()]->name().package) + "-" + stringify(m[k::package_id()]->version()));
tmp_vdb_dir.mkdir();
WriteVDBEntryCommand write_vdb_entry_command(
WriteVDBEntryParams::create()
.environment(_imp->params.environment)
- .package_id(tr1::static_pointer_cast<const ERepositoryID>(m.package_id))
+ .package_id(tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()]))
.output_directory(tmp_vdb_dir)
- .environment_file(m.environment_file));
+ .environment_file(m[k::environment_file()]));
write_vdb_entry_command();
@@ -733,19 +733,19 @@ VDBRepository::merge(const MergeParams & m)
}
FSEntry vdb_dir(_imp->params.location);
- vdb_dir /= stringify(m.package_id->name().category);
- vdb_dir /= (stringify(m.package_id->name().package) + "-" + stringify(m.package_id->version()));
+ vdb_dir /= stringify(m[k::package_id()]->name().category);
+ vdb_dir /= (stringify(m[k::package_id()]->name().package) + "-" + stringify(m[k::package_id()]->version()));
VDBMerger merger(
VDBMergerParams::named_create()
(k::environment(), _imp->params.environment)
- (k::image(), m.image_dir)
+ (k::image(), m[k::image_dir()])
(k::root(), installed_root_key()->value())
(k::contents_file(), vdb_dir / "CONTENTS")
(k::config_protect(), config_protect)
(k::config_protect_mask(), config_protect_mask)
- (k::package_id(), m.package_id)
- (k::options(), m.options));
+ (k::package_id(), m[k::package_id()])
+ (k::options(), m[k::options()]));
if (! merger.check())
{
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index 7704491cc..d556374c3 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008 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
@@ -114,9 +114,9 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1", UserPackageDepSpecOptions()))),
qo_require_exactly_one)->begin());
- TEST_CHECK(repo->use_interface->query_use(UseFlagName("flag1"), *e1) == use_enabled);
- TEST_CHECK(repo->use_interface->query_use(UseFlagName("flag2"), *e1) == use_enabled);
- TEST_CHECK(repo->use_interface->query_use(UseFlagName("flag3"), *e1) == use_disabled);
+ TEST_CHECK((*repo)[k::use_interface()]->query_use(UseFlagName("flag1"), *e1) == use_enabled);
+ TEST_CHECK((*repo)[k::use_interface()]->query_use(UseFlagName("flag2"), *e1) == use_enabled);
+ TEST_CHECK((*repo)[k::use_interface()]->query_use(UseFlagName("flag3"), *e1) == use_disabled);
}
} test_vdb_repository_query_use;
@@ -139,7 +139,7 @@ namespace test_cases
keys->insert("world", "vdb_repository_TEST_dir/world-new-file");
tr1::shared_ptr<Repository> repo(VDBRepository::make_vdb_repository(
&env, keys));
- repo->world_interface->add_to_world(QualifiedPackageName("cat-one/foofoo"));
+ (*repo)[k::world_interface()]->add_to_world(QualifiedPackageName("cat-one/foofoo"));
std::ifstream world("vdb_repository_TEST_dir/world-new-file");
std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>());
TEST_CHECK_EQUAL(world_content, "cat-one/foofoo\n");
@@ -165,7 +165,7 @@ namespace test_cases
keys->insert("world", "vdb_repository_TEST_dir/world-empty");
tr1::shared_ptr<Repository> repo(VDBRepository::make_vdb_repository(
&env, keys));
- repo->world_interface->add_to_world(QualifiedPackageName("cat-one/foofoo"));
+ (*repo)[k::world_interface()]->add_to_world(QualifiedPackageName("cat-one/foofoo"));
std::ifstream world("vdb_repository_TEST_dir/world-empty");
std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>());
TEST_CHECK_EQUAL(world_content, "cat-one/foofoo\n");
@@ -191,7 +191,7 @@ namespace test_cases
keys->insert("world", "vdb_repository_TEST_dir/world-no-match");
tr1::shared_ptr<Repository> repo(VDBRepository::make_vdb_repository(
&env, keys));
- repo->world_interface->add_to_world(QualifiedPackageName("cat-one/foofoo"));
+ (*repo)[k::world_interface()]->add_to_world(QualifiedPackageName("cat-one/foofoo"));
std::ifstream world("vdb_repository_TEST_dir/world-no-match");
std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>());
TEST_CHECK_EQUAL(world_content, "cat-one/foo\ncat-one/bar\ncat-one/oink\ncat-one/foofoo\n");
@@ -217,7 +217,7 @@ namespace test_cases
keys->insert("world", "vdb_repository_TEST_dir/world-match");
tr1::shared_ptr<Repository> repo(VDBRepository::make_vdb_repository(
&env, keys));
- repo->world_interface->add_to_world(QualifiedPackageName("cat-one/foofoo"));
+ (*repo)[k::world_interface()]->add_to_world(QualifiedPackageName("cat-one/foofoo"));
std::ifstream world("vdb_repository_TEST_dir/world-match");
std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>());
TEST_CHECK_EQUAL(world_content, "cat-one/foo\ncat-one/foofoo\ncat-one/bar\n");
@@ -242,7 +242,7 @@ namespace test_cases
keys->insert("world", "vdb_repository_TEST_dir/world-no-match-no-eol");
tr1::shared_ptr<Repository> repo(VDBRepository::make_vdb_repository(
&env, keys));
- repo->world_interface->add_to_world(QualifiedPackageName("cat-one/foofoo"));
+ (*repo)[k::world_interface()]->add_to_world(QualifiedPackageName("cat-one/foofoo"));
std::ifstream world("vdb_repository_TEST_dir/world-no-match-no-eol");
std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>());
TEST_CHECK_EQUAL(world_content, "cat-one/foo\ncat-one/bar\ncat-one/oink\ncat-one/foofoo\n");
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index be66ce9f9..29cb158bc 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -53,21 +53,21 @@ namespace paludis
}
FakeInstalledRepository::FakeInstalledRepository(const Environment * const e, const RepositoryName & our_name) :
- FakeRepositoryBase(e, our_name, RepositoryCapabilities::create()
- .sets_interface(this)
- .syncable_interface(0)
- .use_interface(this)
- .world_interface(0)
- .mirrors_interface(0)
- .environment_variable_interface(0)
- .provides_interface(this)
- .virtuals_interface(0)
- .destination_interface(this)
- .e_interface(0)
- .make_virtuals_interface(0)
- .qa_interface(0)
- .hook_interface(0)
- .manifest_interface(0),
+ FakeRepositoryBase(e, our_name, RepositoryCapabilities::named_create()
+ (k::sets_interface(), this)
+ (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
+ (k::use_interface(), this)
+ (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
+ (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
+ (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
+ (k::provides_interface(), this)
+ (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
+ (k::destination_interface(), this)
+ (k::e_interface(), static_cast<RepositoryEInterface *>(0))
+ (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
+ (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
+ (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
+ (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0)),
"0"),
PrivateImplementationPattern<FakeInstalledRepository>(new Implementation<FakeInstalledRepository>),
_imp(PrivateImplementationPattern<FakeInstalledRepository>::_imp)
@@ -110,9 +110,9 @@ FakeInstalledRepository::provided_packages() const
(*v)->provide_key()->value()->accept(f);
for (DepSpecFlattener<ProvideSpecTree, PackageDepSpec>::ConstIterator q(f.begin()), q_end(f.end()) ; q != q_end ; ++q)
- result->push_back(RepositoryProvidesEntry::create()
- .virtual_name(QualifiedPackageName((*q)->text()))
- .provided_by(*v));
+ result->push_back(RepositoryProvidesEntry::named_create()
+ (k::virtual_name(), QualifiedPackageName((*q)->text()))
+ (k::provided_by(), *v));
}
}
}
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index eaffb75e9..e8dfb7a1e 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -964,9 +964,9 @@ FakeMetadataIUseSetKey::pretty_print_flat(const Formatter<IUseFlag> & f) const
if (! result.empty())
result.append(" ");
- if (_imp->id->repository()->use_interface && _imp->id->repository()->use_interface->query_use_mask(i->flag, *_imp->id))
+ if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_mask(i->flag, *_imp->id))
result.append(f.format(*i, format::Masked()));
- else if (_imp->id->repository()->use_interface && _imp->id->repository()->use_interface->query_use_force(i->flag, *_imp->id))
+ else if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_force(i->flag, *_imp->id))
result.append(f.format(*i, format::Forced()));
else if (_imp->env->query_use(i->flag, *_imp->id))
result.append(f.format(*i, format::Enabled()));
@@ -993,12 +993,12 @@ FakeMetadataIUseSetKey::pretty_print_flat_with_comparison(
std::string l;
bool n;
- if (_imp->id->repository()->use_interface && _imp->id->repository()->use_interface->query_use_mask(i->flag, *_imp->id))
+ if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_mask(i->flag, *_imp->id))
{
l = f.format(*i, format::Masked());
n = false;
}
- else if (_imp->id->repository()->use_interface && _imp->id->repository()->use_interface->query_use_force(i->flag, *_imp->id))
+ else if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_force(i->flag, *_imp->id))
{
l = f.format(*i, format::Forced());
n = true;
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index 35d092ba3..c62704807 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -60,22 +60,22 @@ namespace paludis
FakeRepository::FakeRepository(const Environment * const e, const RepositoryName & our_name) :
PrivateImplementationPattern<FakeRepository>(new Implementation<FakeRepository>),
- FakeRepositoryBase(e, our_name, RepositoryCapabilities::create()
- .sets_interface(this)
- .syncable_interface(0)
- .use_interface(this)
- .world_interface(0)
- .mirrors_interface(this)
- .environment_variable_interface(0)
- .provides_interface(0)
- .virtuals_interface((*DistributionData::get_instance()->distribution_from_string(
+ FakeRepositoryBase(e, our_name, RepositoryCapabilities::named_create()
+ (k::sets_interface(), this)
+ (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
+ (k::use_interface(), this)
+ (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
+ (k::mirrors_interface(), this)
+ (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
+ (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
+ (k::virtuals_interface(), (*DistributionData::get_instance()->distribution_from_string(
e->default_distribution()))[k::support_old_style_virtuals()] ? this : 0)
- .destination_interface(0)
- .e_interface(0)
- .make_virtuals_interface(0)
- .qa_interface(0)
- .hook_interface(0)
- .manifest_interface(0),
+ (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
+ (k::e_interface(), static_cast<RepositoryEInterface *>(0))
+ (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
+ (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
+ (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
+ (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0)),
"0"),
_imp(PrivateImplementationPattern<FakeRepository>::_imp)
{
@@ -84,22 +84,22 @@ FakeRepository::FakeRepository(const Environment * const e, const RepositoryName
FakeRepository::FakeRepository(const FakeRepositoryParams & params) :
PrivateImplementationPattern<FakeRepository>(new Implementation<FakeRepository>),
- FakeRepositoryBase(params.environment, params.name, RepositoryCapabilities::create()
- .sets_interface(this)
- .syncable_interface(0)
- .use_interface(this)
- .world_interface(0)
- .mirrors_interface(this)
- .environment_variable_interface(0)
- .provides_interface(0)
- .virtuals_interface((*DistributionData::get_instance()->distribution_from_string(
+ FakeRepositoryBase(params.environment, params.name, RepositoryCapabilities::named_create()
+ (k::sets_interface(), this)
+ (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
+ (k::use_interface(), this)
+ (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
+ (k::mirrors_interface(), this)
+ (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
+ (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
+ (k::virtuals_interface(), (*DistributionData::get_instance()->distribution_from_string(
params.environment->default_distribution()))[k::support_old_style_virtuals()] ? this : 0)
- .destination_interface(0)
- .e_interface(0)
- .make_virtuals_interface(0)
- .qa_interface(0)
- .hook_interface(0)
- .manifest_interface(0),
+ (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
+ (k::e_interface(), static_cast<RepositoryEInterface *>(0))
+ (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
+ (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
+ (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
+ (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0)),
params.eapi),
_imp(PrivateImplementationPattern<FakeRepository>::_imp)
{
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index 765139f4d..b206cc29b 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -85,21 +85,21 @@ namespace paludis
GemsRepository::GemsRepository(const gems::RepositoryParams & params) :
Repository(RepositoryName("gems"),
- RepositoryCapabilities::create()
- .sets_interface(0)
- .syncable_interface(0)
- .use_interface(0)
- .world_interface(0)
- .environment_variable_interface(0)
- .mirrors_interface(0)
- .virtuals_interface(0)
- .provides_interface(0)
- .destination_interface(0)
- .e_interface(0)
- .qa_interface(0)
- .make_virtuals_interface(0)
- .hook_interface(0)
- .manifest_interface(0)),
+ RepositoryCapabilities::named_create()
+ (k::sets_interface(), static_cast<RepositorySetsInterface *>(0))
+ (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
+ (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
+ (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
+ (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
+ (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
+ (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
+ (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
+ (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
+ (k::e_interface(), static_cast<RepositoryEInterface *>(0))
+ (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
+ (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
+ (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
+ (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
PrivateImplementationPattern<GemsRepository>(new Implementation<GemsRepository>(params)),
_imp(PrivateImplementationPattern<GemsRepository>::_imp)
{
diff --git a/paludis/repositories/gems/installed_gems_repository.cc b/paludis/repositories/gems/installed_gems_repository.cc
index 4beece11b..b826cd5c0 100644
--- a/paludis/repositories/gems/installed_gems_repository.cc
+++ b/paludis/repositories/gems/installed_gems_repository.cc
@@ -85,21 +85,21 @@ namespace paludis
InstalledGemsRepository::InstalledGemsRepository(const gems::InstalledRepositoryParams & params) :
Repository(RepositoryName("installed-gems"),
- RepositoryCapabilities::create()
- .sets_interface(0)
- .syncable_interface(0)
- .use_interface(0)
- .world_interface(0)
- .environment_variable_interface(0)
- .mirrors_interface(0)
- .virtuals_interface(0)
- .provides_interface(0)
- .destination_interface(this)
- .e_interface(0)
- .qa_interface(0)
- .make_virtuals_interface(0)
- .hook_interface(0)
- .manifest_interface(0)),
+ RepositoryCapabilities::named_create()
+ (k::sets_interface(), static_cast<RepositorySetsInterface *>(0))
+ (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
+ (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
+ (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
+ (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
+ (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
+ (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
+ (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
+ (k::destination_interface(), this)
+ (k::e_interface(), static_cast<RepositoryEInterface *>(0))
+ (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
+ (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
+ (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
+ (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
PrivateImplementationPattern<InstalledGemsRepository>(new Implementation<InstalledGemsRepository>(params)),
_imp(PrivateImplementationPattern<InstalledGemsRepository>::_imp)
{
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 16f7e1b78..3f79d2246 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -83,21 +83,21 @@ namespace paludis
InstalledUnpackagedRepository::InstalledUnpackagedRepository(
const RepositoryName & n, const InstalledUnpackagedRepositoryParams & p) :
PrivateImplementationPattern<InstalledUnpackagedRepository>(new Implementation<InstalledUnpackagedRepository>(p)),
- Repository(n, RepositoryCapabilities::create()
- .sets_interface(this)
- .syncable_interface(0)
- .use_interface(0)
- .world_interface(0)
- .mirrors_interface(0)
- .environment_variable_interface(0)
- .provides_interface(0)
- .virtuals_interface(0)
- .make_virtuals_interface(0)
- .destination_interface(this)
- .e_interface(0)
- .hook_interface(0)
- .qa_interface(0)
- .manifest_interface(0)),
+ Repository(n, RepositoryCapabilities::named_create()
+ (k::sets_interface(), this)
+ (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
+ (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
+ (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
+ (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
+ (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
+ (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
+ (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
+ (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
+ (k::destination_interface(), this)
+ (k::e_interface(), static_cast<RepositoryEInterface *>(0))
+ (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
+ (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
+ (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
_imp(PrivateImplementationPattern<InstalledUnpackagedRepository>::_imp)
{
_add_metadata_keys();
@@ -221,20 +221,20 @@ InstalledUnpackagedRepository::some_ids_might_support_action(const SupportsActio
void
InstalledUnpackagedRepository::merge(const MergeParams & m)
{
- Context context("When merging '" + stringify(*m.package_id) + "' at '" + stringify(m.image_dir)
+ Context context("When merging '" + stringify(*m[k::package_id()]) + "' at '" + stringify(m[k::image_dir()])
+ "' to InstalledUnpackagedRepository repository '" + stringify(name()) + "':");
- if (! is_suitable_destination_for(*m.package_id))
- throw InstallActionError("Not a suitable destination for '" + stringify(*m.package_id) + "'");
+ if (! is_suitable_destination_for(*m[k::package_id()]))
+ throw InstallActionError("Not a suitable destination for '" + stringify(*m[k::package_id()]) + "'");
tr1::shared_ptr<const PackageID> if_overwritten_id, if_same_name_id;
{
- tr1::shared_ptr<const PackageIDSequence> ids(package_ids(m.package_id->name()));
+ tr1::shared_ptr<const PackageIDSequence> ids(package_ids(m[k::package_id()]->name()));
for (PackageIDSequence::ConstIterator v(ids->begin()), v_end(ids->end()) ;
v != v_end ; ++v)
{
if_same_name_id = *v;
- if ((*v)->version() == m.package_id->version() && (*v)->slot() == m.package_id->slot())
+ if ((*v)->version() == m[k::package_id()]->version() && (*v)->slot() == m[k::package_id()]->slot())
{
if_overwritten_id = *v;
break;
@@ -247,7 +247,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
uid_dir = if_same_name_id->fs_location_key()->value().dirname();
else
{
- std::string uid(stringify(m.package_id->name().category) + "---" + stringify(m.package_id->name().package));
+ std::string uid(stringify(m[k::package_id()]->name().category) + "---" + stringify(m[k::package_id()]->name().package));
uid_dir /= "data";
uid_dir.mkdir();
uid_dir /= uid;
@@ -255,7 +255,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
}
FSEntry target_ver_dir(uid_dir);
- target_ver_dir /= (stringify(m.package_id->version()) + ":" + stringify(m.package_id->slot()) + ":" + cookie());
+ target_ver_dir /= (stringify(m[k::package_id()]->version()) + ":" + stringify(m[k::package_id()]->slot()) + ":" + cookie());
if (target_ver_dir.exists())
throw InstallActionError("Temporary merge directory '" + stringify(target_ver_dir) + "' already exists, probably "
@@ -264,33 +264,33 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
{
std::ofstream source_repository_file(stringify(target_ver_dir / "source_repository").c_str());
- source_repository_file << m.package_id->repository()->name() << std::endl;
+ source_repository_file << m[k::package_id()]->repository()->name() << std::endl;
if (! source_repository_file)
throw InstallActionError("Could not write to '" + stringify(target_ver_dir / "source_repository") + "'");
}
- if (m.package_id->short_description_key())
+ if (m[k::package_id()]->short_description_key())
{
std::ofstream description_file(stringify(target_ver_dir / "description").c_str());
- description_file << m.package_id->short_description_key()->value() << std::endl;
+ description_file << m[k::package_id()]->short_description_key()->value() << std::endl;
if (! description_file)
throw InstallActionError("Could not write to '" + stringify(target_ver_dir / "description") + "'");
}
- if (m.package_id->build_dependencies_key())
+ if (m[k::package_id()]->build_dependencies_key())
{
std::ofstream build_dependencies_file(stringify(target_ver_dir / "build_dependencies").c_str());
StringifyFormatter f;
- build_dependencies_file << m.package_id->build_dependencies_key()->pretty_print_flat(f) << std::endl;
+ build_dependencies_file << m[k::package_id()]->build_dependencies_key()->pretty_print_flat(f) << std::endl;
if (! build_dependencies_file)
throw InstallActionError("Could not write to '" + stringify(target_ver_dir / "build_dependencies") + "'");
}
- if (m.package_id->run_dependencies_key())
+ if (m[k::package_id()]->run_dependencies_key())
{
std::ofstream run_dependencies_file(stringify(target_ver_dir / "run_dependencies").c_str());
StringifyFormatter f;
- run_dependencies_file << m.package_id->run_dependencies_key()->pretty_print_flat(f) << std::endl;
+ run_dependencies_file << m[k::package_id()]->run_dependencies_key()->pretty_print_flat(f) << std::endl;
if (! run_dependencies_file)
throw InstallActionError("Could not write to '" + stringify(target_ver_dir / "run_dependencies") + "'");
}
@@ -298,12 +298,12 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
NDBAMMerger merger(
NDBAMMergerParams::create()
.environment(_imp->params.environment)
- .image(m.image_dir)
+ .image(m[k::image_dir()])
.root(installed_root_key()->value())
.contents_file(target_ver_dir / "contents")
.config_protect(getenv_with_default("CONFIG_PROTECT", ""))
.config_protect_mask(getenv_with_default("CONFIG_PROTECT_MASK", ""))
- .package_id(m.package_id)
+ .package_id(m[k::package_id()])
.options(MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs));
if (! merger.check())
@@ -316,7 +316,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
merger.merge();
- _imp->ndbam.index(m.package_id->name(), uid_dir.basename());
+ _imp->ndbam.index(m[k::package_id()]->name(), uid_dir.basename());
if (if_overwritten_id)
{
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index a417fb623..6ccf5ceb7 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -300,17 +300,17 @@ UnpackagedID::perform_action(Action & action) const
if (! install_action)
throw UnsupportedActionError(*this, action);
- if (! install_action->options[k::destination()]->destination_interface)
+ if (! (*install_action->options[k::destination()])[k::destination_interface()])
throw InstallActionError("Can't install '" + stringify(*this)
+ "' to destination '" + stringify(install_action->options[k::destination()]->name())
+ "' because destination does not provide destination_interface");
- install_action->options[k::destination()]->destination_interface->merge(
- MergeParams::create()
- .package_id(shared_from_this())
- .image_dir(fs_location_key()->value())
- .environment_file(FSEntry("/dev/null"))
- .options(MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs)
+ (*install_action->options[k::destination()])[k::destination_interface()]->merge(
+ MergeParams::named_create()
+ (k::package_id(), shared_from_this())
+ (k::image_dir(), fs_location_key()->value())
+ (k::environment_file(), FSEntry("/dev/null"))
+ (k::options(), MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs)
);
}
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.cc b/paludis/repositories/unpackaged/unpackaged_repository.cc
index d1331e3e7..de09f1f03 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository.cc
@@ -86,21 +86,21 @@ namespace paludis
UnpackagedRepository::UnpackagedRepository(const RepositoryName & n,
const UnpackagedRepositoryParams & params) :
PrivateImplementationPattern<UnpackagedRepository>(new Implementation<UnpackagedRepository>(n, params)),
- Repository(n, RepositoryCapabilities::create()
- .sets_interface(0)
- .syncable_interface(0)
- .use_interface(0)
- .world_interface(0)
- .mirrors_interface(0)
- .environment_variable_interface(0)
- .provides_interface(0)
- .virtuals_interface(0)
- .make_virtuals_interface(0)
- .destination_interface(0)
- .e_interface(0)
- .hook_interface(0)
- .qa_interface(0)
- .manifest_interface(0)),
+ Repository(n, RepositoryCapabilities::named_create()
+ (k::sets_interface(), static_cast<RepositorySetsInterface *>(0))
+ (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
+ (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
+ (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
+ (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
+ (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
+ (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
+ (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
+ (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
+ (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
+ (k::e_interface(), static_cast<RepositoryEInterface *>(0))
+ (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
+ (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
+ (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
_imp(PrivateImplementationPattern<UnpackagedRepository>::_imp)
{
_add_metadata_keys();
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index e3625dfb9..5441beb17 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -106,21 +106,21 @@ namespace
InstalledVirtualsRepository::InstalledVirtualsRepository(const Environment * const env,
const FSEntry & r) :
- Repository(RepositoryName(make_name(r)), RepositoryCapabilities::create()
- .use_interface(0)
- .sets_interface(0)
- .syncable_interface(0)
- .mirrors_interface(0)
- .environment_variable_interface(0)
- .world_interface(0)
- .provides_interface(0)
- .virtuals_interface(0)
- .destination_interface(0)
- .e_interface(0)
- .make_virtuals_interface(0)
- .qa_interface(0)
- .hook_interface(this)
- .manifest_interface(0)),
+ Repository(RepositoryName(make_name(r)), RepositoryCapabilities::named_create()
+ (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
+ (k::sets_interface(), static_cast<RepositorySetsInterface *>(0))
+ (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
+ (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
+ (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
+ (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
+ (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
+ (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
+ (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
+ (k::e_interface(), static_cast<RepositoryEInterface *>(0))
+ (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
+ (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
+ (k::hook_interface(), this)
+ (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
PrivateImplementationPattern<InstalledVirtualsRepository>(
new Implementation<InstalledVirtualsRepository>(env, r)),
_imp(PrivateImplementationPattern<InstalledVirtualsRepository>::_imp)
@@ -147,21 +147,21 @@ InstalledVirtualsRepository::need_ids() const
for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
{
- if (! (*r)->provides_interface)
+ if (! (**r)[k::provides_interface()])
continue;
tr1::shared_ptr<const RepositoryProvidesInterface::ProvidesSequence> pp(
- (*r)->provides_interface->provided_packages());
+ (**r)[k::provides_interface()]->provided_packages());
for (RepositoryProvidesInterface::ProvidesSequence::ConstIterator p(
pp->begin()), p_end(pp->end()) ; p != p_end ; ++p)
{
- IDMap::iterator i(_imp->ids.find(p->virtual_name));
+ IDMap::iterator i(_imp->ids.find((*p)[k::virtual_name()]));
if (i == _imp->ids.end())
- i = _imp->ids.insert(std::make_pair(p->virtual_name, make_shared_ptr(new PackageIDSequence))).first;
+ i = _imp->ids.insert(std::make_pair((*p)[k::virtual_name()], make_shared_ptr(new PackageIDSequence))).first;
tr1::shared_ptr<const PackageID> id(new virtuals::VirtualsPackageID(
- _imp->env, shared_from_this(), p->virtual_name, p->provided_by, false));
+ _imp->env, shared_from_this(), (*p)[k::virtual_name()], (*p)[k::provided_by()], false));
i->second->push_back(id);
}
}
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index ecbba9a77..0f1c6f449 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -113,21 +113,21 @@ namespace
}
VirtualsRepository::VirtualsRepository(const Environment * const env) :
- Repository(RepositoryName("virtuals"), RepositoryCapabilities::create()
- .use_interface(0)
- .sets_interface(0)
- .syncable_interface(0)
- .mirrors_interface(0)
- .environment_variable_interface(0)
- .world_interface(0)
- .provides_interface(0)
- .virtuals_interface(0)
- .destination_interface(0)
- .e_interface(0)
- .make_virtuals_interface(this)
- .qa_interface(0)
- .hook_interface(0)
- .manifest_interface(0)),
+ Repository(RepositoryName("virtuals"), RepositoryCapabilities::named_create()
+ (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
+ (k::sets_interface(), static_cast<RepositorySetsInterface *>(0))
+ (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
+ (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
+ (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
+ (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
+ (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
+ (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
+ (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
+ (k::e_interface(), static_cast<RepositoryEInterface *>(0))
+ (k::make_virtuals_interface(), this)
+ (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
+ (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
+ (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
PrivateImplementationPattern<VirtualsRepository>(
new Implementation<VirtualsRepository>(env)),
_imp(PrivateImplementationPattern<VirtualsRepository>::_imp)
@@ -155,15 +155,15 @@ VirtualsRepository::need_names() const
for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
{
- if (! (*r)->provides_interface)
+ if (! (**r)[k::provides_interface()])
continue;
tr1::shared_ptr<const RepositoryProvidesInterface::ProvidesSequence> provides(
- (*r)->provides_interface->provided_packages());
+ (**r)[k::provides_interface()]->provided_packages());
for (RepositoryProvidesInterface::ProvidesSequence::ConstIterator p(provides->begin()),
p_end(provides->end()) ; p != p_end ; ++p)
- _imp->names.push_back(std::make_pair(p->virtual_name, tr1::shared_ptr<const PackageDepSpec>(
- new PackageDepSpec(make_package_dep_spec().package(p->provided_by->name())))));
+ _imp->names.push_back(std::make_pair((*p)[k::virtual_name()], tr1::shared_ptr<const PackageDepSpec>(
+ new PackageDepSpec(make_package_dep_spec().package((*p)[k::provided_by()]->name())))));
}
std::sort(_imp->names.begin(), _imp->names.end(), NamesSortComparator());
@@ -174,11 +174,11 @@ VirtualsRepository::need_names() const
for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
{
- if (! (*r)->virtuals_interface)
+ if (! (**r)[k::virtuals_interface()])
continue;
tr1::shared_ptr<const RepositoryVirtualsInterface::VirtualsSequence> virtuals(
- (*r)->virtuals_interface->virtual_packages());
+ (**r)[k::virtuals_interface()]->virtual_packages());
for (RepositoryVirtualsInterface::VirtualsSequence::ConstIterator v(virtuals->begin()),
v_end(virtuals->end()) ; v != v_end ; ++v)
{
@@ -186,11 +186,11 @@ VirtualsRepository::need_names() const
std::vector<std::pair<QualifiedPackageName, tr1::shared_ptr<const PackageDepSpec> > >::const_iterator,
std::vector<std::pair<QualifiedPackageName, tr1::shared_ptr<const PackageDepSpec> > >::const_iterator> p(
std::equal_range(_imp->names.begin(), _imp->names.end(),
- std::make_pair(v->virtual_name, tr1::shared_ptr<const PackageDepSpec>()),
+ std::make_pair((*v)[k::virtual_name()], tr1::shared_ptr<const PackageDepSpec>()),
NamesNameComparator()));
if (p.first == p.second)
- new_names.push_back(std::make_pair(v->virtual_name, v->provided_by_spec));
+ new_names.push_back(std::make_pair((*v)[k::virtual_name()], (*v)[k::provided_by_spec()]));
}
}
diff --git a/paludis/repositories/virtuals/virtuals_repository_TEST.cc b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
index 1cde168de..941908d7e 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 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -49,7 +49,7 @@ namespace test_cases
tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
tr1::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(&env, RepositoryName("installed")));
- TEST_CHECK(repo->virtuals_interface);
+ TEST_CHECK((*repo)[k::virtuals_interface()]);
env.package_database()->add_repository(2, virtuals);
env.package_database()->add_repository(3, repo);