aboutsummaryrefslogtreecommitdiff
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
parent690aca7a8de4bf9b682be59abbed08a8d12a21d8 (diff)
downloadpaludis-981dd553a590eff046d49bccd06f2cb61963edee.tar.gz
paludis-981dd553a590eff046d49bccd06f2cb61963edee.tar.xz
More sr -> kc
-rw-r--r--paludis/args/install_args_group.cc4
-rw-r--r--paludis/dep_list.cc8
-rw-r--r--paludis/environment_implementation.cc16
-rw-r--r--paludis/environments/no_config/no_config_environment.cc20
-rw-r--r--paludis/environments/paludis/paludis_environment.cc12
-rw-r--r--paludis/environments/paludis/use_conf.cc4
-rw-r--r--paludis/environments/portage/portage_environment.cc12
-rw-r--r--paludis/files.m44
-rw-r--r--paludis/hooker.cc10
-rw-r--r--paludis/install_task.cc12
-rw-r--r--paludis/report_task.cc4
-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
-rw-r--r--paludis/repository-fwd.hh91
-rw-r--r--paludis/repository.cc2
-rw-r--r--paludis/repository.hh3
-rw-r--r--paludis/repository.sr121
-rw-r--r--paludis/sync_task.cc4
-rw-r--r--paludis/syncer.cc33
-rw-r--r--paludis/syncer.hh41
-rw-r--r--paludis/syncer.sr43
-rw-r--r--paludis/uninstall_task.cc8
-rw-r--r--paludis/util/keys.hh27
-rw-r--r--python/repository.cc38
-rw-r--r--ruby/repository.cc90
-rw-r--r--src/clients/adjutrix/display_default_system_resolution.cc16
-rw-r--r--src/clients/adjutrix/downgrade_check.cc18
-rw-r--r--src/clients/adjutrix/find_insecure_packages.cc6
-rw-r--r--src/clients/adjutrix/find_unused_packages.cc2
-rw-r--r--src/clients/adjutrix/keywords_graph.cc6
-rw-r--r--src/clients/adjutrix/what_needs_keywording.cc4
-rw-r--r--src/clients/gtkpaludis/libgtkpaludis/repository_buttons.cc2
-rw-r--r--src/clients/gtkpaludis/libgtkpaludis/sets_list_model.cc4
-rw-r--r--src/clients/paludis/applets.cc2
-rw-r--r--src/clients/paludis/list.cc6
-rw-r--r--src/clients/qualudis/qualudis.cc6
-rw-r--r--src/output/console_install_task.cc2
63 files changed, 719 insertions, 743 deletions
diff --git a/paludis/args/install_args_group.cc b/paludis/args/install_args_group.cc
index 59b346a..9da8d29 100644
--- a/paludis/args/install_args_group.cc
+++ b/paludis/args/install_args_group.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
* Copyright (c) 2007 David Leverton
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -94,7 +94,7 @@ InstallArgsGroup::destinations(Environment * env) const
{
tr1::shared_ptr<Repository> repo(env->package_database()->fetch_repository(
RepositoryName(*i)));
- if (repo->destination_interface)
+ if ((*repo)[k::destination_interface()])
d->insert(repo);
else
throw args::DoHelp("--destinations argument '" + *i + "' does not provide a destinations interface");
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index 8152d38..599dde0 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -1042,8 +1042,8 @@ DepList::add_package(const tr1::shared_ptr<const PackageID> & p, tr1::shared_ptr
our_merge_entry_post_position = _imp->merge_list.insert(next(our_merge_entry_post_position),
DepListEntry(DepListEntry::create()
- .package_id(_imp->env->package_database()->fetch_repository(
- RepositoryName("virtuals"))->make_virtuals_interface->make_virtual_package_id(
+ .package_id((*_imp->env->package_database()->fetch_repository(
+ RepositoryName("virtuals")))[k::make_virtuals_interface()]->make_virtual_package_id(
QualifiedPackageName((*i)->text()), p))
.generation(_imp->merge_list_generation)
.state(dle_has_all_deps)
@@ -1486,8 +1486,8 @@ DepList::find_destination(const PackageID & p,
{
for (DestinationsSet::ConstIterator d(dd->begin()), d_end(dd->end()) ;
d != d_end ; ++d)
- if ((*d)->destination_interface)
- if ((*d)->destination_interface->is_suitable_destination_for(p))
+ if ((**d)[k::destination_interface()])
+ if ((**d)[k::destination_interface()]->is_suitable_destination_for(p))
return *d;
throw NoDestinationError(p, dd);
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index 8fe9ded..e30afd9 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -78,8 +78,8 @@ EnvironmentImplementation::default_destinations() const
for (PackageDatabase::RepositoryConstIterator r(package_database()->begin_repositories()),
r_end(package_database()->end_repositories()) ;
r != r_end ; ++r)
- if ((*r)->destination_interface)
- if ((*r)->destination_interface->is_default_destination())
+ if ((**r)[k::destination_interface()])
+ if ((**r)[k::destination_interface()]->is_default_destination())
result->insert(*r);
return result;
@@ -111,10 +111,10 @@ EnvironmentImplementation::set(const SetName & s) const
r_end(package_database()->end_repositories()) ;
r != r_end ; ++r)
{
- if (! (*r)->sets_interface)
+ if (! (**r)[k::sets_interface()])
continue;
- tr1::shared_ptr<SetSpecTree::ConstItem> add((*r)->sets_interface->package_set(s));
+ tr1::shared_ptr<SetSpecTree::ConstItem> add((**r)[k::sets_interface()]->package_set(s));
if (add)
{
Log::get_instance()->message(ll_debug, lc_context) << "Set '" << s << "' found in '" << (*r)->name() << "'";
@@ -136,14 +136,14 @@ EnvironmentImplementation::set(const SetName & s) const
bool
EnvironmentImplementation::query_use(const UseFlagName & f, const PackageID & e) const
{
- if (e.repository()->use_interface)
+ if ((*e.repository())[k::use_interface()])
{
- if (e.repository()->use_interface->query_use_mask(f, e))
+ if ((*e.repository())[k::use_interface()]->query_use_mask(f, e))
return false;
- if (e.repository()->use_interface->query_use_force(f, e))
+ if ((*e.repository())[k::use_interface()]->query_use_force(f, e))
return true;
- switch (e.repository()->use_interface->query_use(f, e))
+ switch ((*e.repository())[k::use_interface()]->query_use(f, e))
{
case use_disabled:
case use_unspecified:
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index 8cd1b2b..dd9657f 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -233,14 +233,14 @@ NoConfigEnvironment::NoConfigEnvironment(const no_config_environment::Params & p
_imp->initialise(this);
if (_imp->main_repo)
- if (_imp->main_repo->e_interface->end_profiles() != _imp->main_repo->e_interface->begin_profiles())
- _imp->main_repo->e_interface->set_profile(_imp->main_repo->e_interface->begin_profiles());
+ if ((*_imp->main_repo)[k::e_interface()]->end_profiles() != (*_imp->main_repo)[k::e_interface()]->begin_profiles())
+ (*_imp->main_repo)[k::e_interface()]->set_profile((*_imp->main_repo)[k::e_interface()]->begin_profiles());
if (_imp->master_repo)
- if (_imp->master_repo->e_interface->end_profiles() !=
- _imp->master_repo->e_interface->begin_profiles())
- _imp->master_repo->e_interface->set_profile(
- _imp->master_repo->e_interface->begin_profiles());
+ if ((*_imp->master_repo)[k::e_interface()]->end_profiles() !=
+ (*_imp->master_repo)[k::e_interface()]->begin_profiles())
+ (*_imp->master_repo)[k::e_interface()]->set_profile(
+ (*_imp->master_repo)[k::e_interface()]->begin_profiles());
}
NoConfigEnvironment::~NoConfigEnvironment()
@@ -318,19 +318,19 @@ NoConfigEnvironment::accept_keywords(tr1::shared_ptr<const KeywordNameSet> keywo
if (_imp->is_vdb)
return true;
- std::string accept_keywords_var(_imp->main_repo->e_interface->accept_keywords_variable());
+ std::string accept_keywords_var((*_imp->main_repo)[k::e_interface()]->accept_keywords_variable());
std::string ak;
if (! accept_keywords_var.empty())
- ak = _imp->main_repo->e_interface->profile_variable(accept_keywords_var);
+ ak = (*_imp->main_repo)[k::e_interface()]->profile_variable(accept_keywords_var);
if (ak.empty())
{
- std::string arch_var(_imp->main_repo->e_interface->arch_variable());
+ std::string arch_var((*_imp->main_repo)[k::e_interface()]->arch_variable());
if (arch_var.empty())
throw ConfigurationError("Don't know how to work out whether keywords are acceptable");
- std::string arch(_imp->main_repo->e_interface->profile_variable(arch_var));
+ std::string arch((*_imp->main_repo)[k::e_interface()]->profile_variable(arch_var));
if (keywords->end() != keywords->find(KeywordName(arch)))
return true;
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index de028db..61549ce 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 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
@@ -181,11 +181,11 @@ PaludisEnvironment::query_use(const UseFlagName & f, const PackageID & e) const
Save<bool> save_recursive(&recursive, true);
/* first check package database use masks... */
- if (e.repository()->use_interface)
+ if ((*e.repository())[k::use_interface()])
{
- if (e.repository()->use_interface->query_use_mask(f, e))
+ if ((*e.repository())[k::use_interface()]->query_use_mask(f, e))
return false;
- if (e.repository()->use_interface->query_use_force(f, e))
+ if ((*e.repository())[k::use_interface()]->query_use_force(f, e))
return true;
}
@@ -210,9 +210,9 @@ PaludisEnvironment::query_use(const UseFlagName & f, const PackageID & e) const
} while (false);
/* check use: package database config */
- if (e.repository()->use_interface)
+ if ((*e.repository())[k::use_interface()])
{
- switch (e.repository()->use_interface->query_use(f, e))
+ switch ((*e.repository())[k::use_interface()]->query_use(f, e))
{
case use_disabled:
case use_unspecified:
diff --git a/paludis/environments/paludis/use_conf.cc b/paludis/environments/paludis/use_conf.cc
index 0ed0439..cc72e83 100644
--- a/paludis/environments/paludis/use_conf.cc
+++ b/paludis/environments/paludis/use_conf.cc
@@ -201,9 +201,9 @@ UseConf::query(const UseFlagName & f, const PackageID & e) const
UseFlagState result(use_unspecified);
bool ignore_empty_minus_star(false);
- if (e.repository()->use_interface)
+ if ((*e.repository())[k::use_interface()])
{
- tr1::shared_ptr<const UseFlagNameSet> prefixes(e.repository()->use_interface->use_expand_prefixes());
+ tr1::shared_ptr<const UseFlagNameSet> prefixes((*e.repository())[k::use_interface()]->use_expand_prefixes());
for (UseFlagNameSet::ConstIterator p(prefixes->begin()), p_end(prefixes->end()) ;
p != p_end ; ++p)
if (0 == p->data().compare(0, p->data().length(), stringify(f), 0, p->data().length()))
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index dd4c1bb..2bbeb80 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.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
@@ -448,19 +448,19 @@ PortageEnvironment::query_use(const UseFlagName & f, const PackageID & e) const
Save<bool> save_recursive(&recursive, true);
/* first check package database use masks... */
- if (e.repository()->use_interface)
+ if ((*e.repository())[k::use_interface()])
{
- if (e.repository()->use_interface->query_use_mask(f, e))
+ if ((*e.repository())[k::use_interface()]->query_use_mask(f, e))
return false;
- if (e.repository()->use_interface->query_use_force(f, e))
+ if ((*e.repository())[k::use_interface()]->query_use_force(f, e))
return true;
}
UseFlagState state(use_unspecified);
/* check use: repo */
- if (e.repository()->use_interface)
- state = e.repository()->use_interface->query_use(f, e);
+ if ((*e.repository())[k::use_interface()])
+ state = (*e.repository())[k::use_interface()]->query_use(f, e);
/* check use: general user config */
std::set<std::string>::const_iterator u(_imp->use_with_expands.find(stringify(f)));
diff --git a/paludis/files.m4 b/paludis/files.m4
index 885b2dd..978e014 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -54,7 +54,7 @@ add(`query_delegate', `hh', `cc', `fwd')
add(`query_visitor', `hh', `cc')
add(`range_rewriter', `hh', `cc', `test')
add(`report_task', `hh', `cc')
-add(`repository', `hh', `fwd', `cc', `sr')
+add(`repository', `hh', `fwd', `cc')
add(`repository_maker', `hh', `cc')
add(`repository_name_cache', `hh', `cc', `test', `testscript')
add(`set_file', `hh', `cc', `se', `sr', `test', `testscript')
@@ -62,7 +62,7 @@ add(`show_suggest_visitor', `hh', `cc')
add(`stage_builder_task', `hh', `cc')
add(`stage_options', `sr')
add(`stringify_formatter', `hh', `cc', `fwd', `impl', `test')
-add(`syncer', `hh', `cc', `sr')
+add(`syncer', `hh', `cc')
add(`sync_task', `hh', `cc')
add(`tasks_exceptions', `hh', `cc')
add(`uninstall_list', `hh', `cc', `se', `sr', `test')
diff --git a/paludis/hooker.cc b/paludis/hooker.cc
index 4b4aa42..2f3e2aa 100644
--- a/paludis/hooker.cc
+++ b/paludis/hooker.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
* Copyright (c) 2007 Piotr JaroszyƄski
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -424,17 +424,17 @@ Hooker::perform_hook(const Hook & hook) const
case hod_stdout:
for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
- if ((*r)->hook_interface)
+ if ((**r)[k::hook_interface()])
result.max_exit_status = std::max(result.max_exit_status,
- ((*r)->hook_interface->perform_hook(hook)).max_exit_status);
+ ((**r)[k::hook_interface()]->perform_hook(hook)).max_exit_status);
continue;
case hod_grab:
for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
- if ((*r)->hook_interface)
+ if ((**r)[k::hook_interface()])
{
- HookResult tmp((*r)->hook_interface->perform_hook(hook));
+ HookResult tmp((**r)[k::hook_interface()]->perform_hook(hook));
if (tmp > result)
result = tmp;
else if (! tmp.output.empty())
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index 36fce93..b975007 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -440,7 +440,7 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
bool live_destination(false);
if (dep->destination)
- if (dep->destination->destination_interface && dep->destination->destination_interface->want_pre_post_phases())
+ if ((*dep->destination)[k::destination_interface()] && (*dep->destination)[k::destination_interface()]->want_pre_post_phases())
live_destination = true;
/* we're about to fetch / install one item */
@@ -623,7 +623,7 @@ InstallTask::_main_actions()
for (DepList::Iterator dep(_imp->dep_list.begin()), dep_end(_imp->dep_list.end()) ;
dep != dep_end && ! any_live_destination ; ++dep)
if (dlk_package == dep->kind && dep->destination)
- if (dep->destination->destination_interface && dep->destination->destination_interface->want_pre_post_phases())
+ if ((*dep->destination)[k::destination_interface()] && (*dep->destination)[k::destination_interface()]->want_pre_post_phases())
any_live_destination = true;
if (0 != perform_hook(Hook("install_all_pre")
@@ -966,8 +966,8 @@ InstallTask::world_update_set(const SetName & s)
for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
r_end(_imp->env->package_database()->end_repositories()) ;
r != r_end ; ++r)
- if ((*r)->world_interface)
- (*r)->world_interface->add_to_world(s);
+ if ((**r)[k::world_interface()])
+ (**r)[k::world_interface()]->add_to_world(s);
on_update_world(s);
}
@@ -1000,8 +1000,8 @@ namespace
for (PackageDatabase::RepositoryConstIterator r(env->package_database()->begin_repositories()),
r_end(env->package_database()->end_repositories()) ;
r != r_end ; ++r)
- if ((*r)->world_interface && a.package_ptr())
- (*r)->world_interface->add_to_world(*a.package_ptr());
+ if ((**r)[k::world_interface()] && a.package_ptr())
+ (**r)[k::world_interface()]->add_to_world(*a.package_ptr());
task->on_update_world(a);
}
}
diff --git a/paludis/report_task.cc b/paludis/report_task.cc
index 10cbd86..039223a 100644
--- a/paludis/report_task.cc
+++ b/paludis/report_task.cc
@@ -140,12 +140,12 @@ ReportTask::execute()
r_end(e->package_database()->end_repositories()) ; r != r_end ; ++r)
{
tr1::shared_ptr<const Repository> rr(e->package_database()->fetch_repository((*r)->name()));
- if (! rr->sets_interface)
+ if (! (*rr)[k::sets_interface()])
continue;
try
{
- tr1::shared_ptr<const SetSpecTree::ConstItem> insecure(rr->sets_interface->package_set(SetName("insecurity")));
+ tr1::shared_ptr<const SetSpecTree::ConstItem> insecure((*rr)[k::sets_interface()]->package_set(SetName("insecurity")));
if (! insecure)
continue;
insecure->accept(vuln);
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index 2e8db04..8c8dd42 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 28ade05..a86d6aa 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 3ec276f..48f58ba 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 3bcceb0..8fedae8 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 b8d74c5..ac35165 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 e444f38..a194c86 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 2c2a865..62afe18 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 f9cc039..8eac497 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 d219337..e752218 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 f62eb52..7d62b1b 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 eae5aa6..cec9f70 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 93016c7..b0c1a2b 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 ed931d8..1af5795 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 83c2e8d..586b283 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 c082899..10b5c1c 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 30066f3..f51a0d1 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 7704491..d556374 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 be66ce9..29cb158 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 eaffb75..e8dfb7a 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 35d092b..c627048 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 765139f..b206cc2 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 4beece1..b826cd5 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 16f7e1b..3f79d22 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 a417fb6..6ccf5ce 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 d1331e3..de09f1f 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 e3625df..5441beb 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 ecbba9a..0f1c6f4 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 1cde168..941908d 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);
diff --git a/paludis/repository-fwd.hh b/paludis/repository-fwd.hh
index ca968a2..9ddfab9 100644
--- a/paludis/repository-fwd.hh
+++ b/paludis/repository-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 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
@@ -21,7 +21,14 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORY_FWD_HH 1
#include <paludis/util/set-fwd.hh>
+#include <paludis/util/kc-fwd.hh>
+#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/keys.hh>
#include <paludis/util/tr1_memory.hh>
+#include <paludis/name-fwd.hh>
+#include <paludis/merger-fwd.hh>
+#include <paludis/package_id-fwd.hh>
+#include <paludis/dep_spec-fwd.hh>
/** \file
* Forward declarations for paludis/repository.hh .
@@ -56,8 +63,6 @@ namespace paludis
class RepositoryQAInterface;
class RepositoryManifestInterface;
- class MergeParams;
-
/**
* A set of destinations, used to decide whether a PackageID can be
* installed to a particular Repository.
@@ -65,6 +70,86 @@ namespace paludis
* \ingroup g_repository
*/
typedef Set<paludis::tr1::shared_ptr<Repository> > DestinationsSet;
+
+
+ /**
+ * Optional interfaces that may be provided by a Repository.
+ *
+ * \see Repository
+ * \ingroup g_repository
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::sets_interface, RepositorySetsInterface *>,
+ kc::Field<k::syncable_interface, RepositorySyncableInterface *>,
+ kc::Field<k::use_interface, RepositoryUseInterface *>,
+ kc::Field<k::world_interface, RepositoryWorldInterface *>,
+ kc::Field<k::mirrors_interface, RepositoryMirrorsInterface *>,
+ kc::Field<k::environment_variable_interface, RepositoryEnvironmentVariableInterface *>,
+ kc::Field<k::provides_interface, RepositoryProvidesInterface *>,
+ kc::Field<k::virtuals_interface, RepositoryVirtualsInterface *>,
+ kc::Field<k::make_virtuals_interface, RepositoryMakeVirtualsInterface *>,
+ kc::Field<k::destination_interface, RepositoryDestinationInterface *>,
+ kc::Field<k::e_interface, RepositoryEInterface *>,
+ kc::Field<k::hook_interface, RepositoryHookInterface *>,
+ kc::Field<k::qa_interface, RepositoryQAInterface *>,
+ kc::Field<k::manifest_interface, RepositoryManifestInterface *>
+ > RepositoryCapabilities;
+
+ /**
+ * A profiles.desc line in a Repository implementing RepositoryEInterface.
+ *
+ * \see Repository
+ * \see RepositoryEInterface
+ * \ingroup g_repository
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::path, FSEntry>,
+ kc::Field<k::arch, std::string>,
+ kc::Field<k::status, std::string>,
+ kc::Field<k::profile, tr1::shared_ptr<ERepositoryProfile> >
+ >RepositoryEInterfaceProfilesDescLine;
+
+ /**
+ * A provides entry in a Repository implementing RepositoryProvidesInterface.
+ *
+ * \see Repository
+ * \see RepositoryProvidesInterface
+ * \ingroup g_repository
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::virtual_name, QualifiedPackageName>,
+ kc::Field<k::provided_by, tr1::shared_ptr<const PackageID> >
+ > RepositoryProvidesEntry;
+
+ /**
+ * A virtuals entry in a Repository implementing RepositoryVirtualsInterface.
+ *
+ * \see Repository
+ * \see RepositoryVirtualsInterface
+ * \ingroup g_repository
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::virtual_name, QualifiedPackageName>,
+ kc::Field<k::provided_by_spec, tr1::shared_ptr<const PackageDepSpec> >
+ > RepositoryVirtualsEntry;
+
+ /**
+ * Parameters for RepositoryDestinationInterface::merge.
+ *
+ * \see RepositoryDestinationInterface
+ * \ingroup g_repository
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::package_id, tr1::shared_ptr<const PackageID> >,
+ kc::Field<k::image_dir, FSEntry>,
+ kc::Field<k::environment_file, FSEntry>,
+ kc::Field<k::options, MergerOptions>
+ > MergeParams;
}
#endif
diff --git a/paludis/repository.cc b/paludis/repository.cc
index 44473b7..9b5a22f 100644
--- a/paludis/repository.cc
+++ b/paludis/repository.cc
@@ -41,8 +41,6 @@
using namespace paludis;
-#include <paludis/repository-sr.cc>
-
template class Set<tr1::shared_ptr<Repository> >;
template class WrappedForwardIterator<Set<tr1::shared_ptr<Repository> >::ConstIteratorTag, const tr1::shared_ptr<Repository> >;
template class WrappedOutputIterator<Set<tr1::shared_ptr<Repository> >::InserterTag, tr1::shared_ptr<Repository> >;
diff --git a/paludis/repository.hh b/paludis/repository.hh
index d6c16ba..51beacf 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -34,6 +34,7 @@
#include <paludis/util/virtual_constructor.hh>
#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/kc.hh>
#include <paludis/version_spec.hh>
#include <paludis/metadata_key-fwd.hh>
#include <paludis/metadata_key_holder.hh>
@@ -121,8 +122,6 @@ namespace paludis
}
};
-#include <paludis/repository-sr.hh>
-
/**
* A Repository provides a representation of a physical repository to a
* PackageDatabase.
diff --git a/paludis/repository.sr b/paludis/repository.sr
deleted file mode 100644
index b6383a1..0000000
--- a/paludis/repository.sr
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-make_class_RepositoryCapabilities()
-{
- visible
-
- key sets_interface "RepositorySetsInterface *"
- key syncable_interface "RepositorySyncableInterface *"
- key use_interface "RepositoryUseInterface *"
- key world_interface "RepositoryWorldInterface *"
- key mirrors_interface "RepositoryMirrorsInterface *"
- key environment_variable_interface "RepositoryEnvironmentVariableInterface *"
- key provides_interface "RepositoryProvidesInterface *"
- key virtuals_interface "RepositoryVirtualsInterface *"
- key make_virtuals_interface "RepositoryMakeVirtualsInterface *"
- key destination_interface "RepositoryDestinationInterface *"
- key e_interface "RepositoryEInterface *"
- key hook_interface "RepositoryHookInterface *"
- key qa_interface "RepositoryQAInterface *"
- key manifest_interface "RepositoryManifestInterface *"
-
- doxygen_comment << "END"
- /**
- * Optional interfaces that may be provided by a Repository.
- *
- * \see Repository
- * \ingroup g_repository
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
-make_class_RepositoryEInterfaceProfilesDescLine()
-{
- visible
-
- key path FSEntry
- key arch std::string
- key status std::string
- key profile "tr1::shared_ptr<ERepositoryProfile>"
- allow_named_args
-
- doxygen_comment << "END"
- /**
- * A profiles.desc line in a Repository implementing RepositoryEInterface.
- *
- * \see Repository
- * \see RepositoryEInterface
- * \ingroup g_repository
- * \nosubgrouping
- */
-END
-}
-
-make_class_RepositoryProvidesEntry()
-{
- visible
-
- key virtual_name QualifiedPackageName
- key provided_by "tr1::shared_ptr<const PackageID>"
-
- allow_named_args
-
- doxygen_comment << "END"
- /**
- * A provides entry in a Repository implementing RepositoryProvidesInterface.
- *
- * \see Repository
- * \see RepositoryProvidesInterface
- * \ingroup g_repository
- * \nosubgrouping
- */
-END
-}
-
-make_class_RepositoryVirtualsEntry()
-{
- visible
-
- key virtual_name QualifiedPackageName
- key provided_by_spec "tr1::shared_ptr<const PackageDepSpec>"
-
- allow_named_args
-
- doxygen_comment << "END"
- /**
- * A virtuals entry in a Repository implementing RepositoryVirtualsInterface.
- *
- * \see Repository
- * \see RepositoryVirtualsInterface
- * \ingroup g_repository
- * \nosubgrouping
- */
-END
-}
-
-make_class_MergeParams()
-{
- visible
-
- key package_id "tr1::shared_ptr<const PackageID>"
- key image_dir FSEntry
- key environment_file FSEntry
- key options MergerOptions
-
- allow_named_args
-
- doxygen_comment << "END"
- /**
- * Parameters for RepositoryDestinationInterface::merge.
- *
- * \see RepositoryDestinationInterface
- * \ingroup g_repository
- * \nosubgrouping
- */
-END
-}
-
diff --git a/paludis/sync_task.cc b/paludis/sync_task.cc
index a76b0d9..dfdf987 100644
--- a/paludis/sync_task.cc
+++ b/paludis/sync_task.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
@@ -112,7 +112,7 @@ namespace
}
tr1::shared_ptr<const Repository> rr(env->package_database()->fetch_repository(r));
- if (rr->syncable_interface && rr->syncable_interface->sync())
+ if ((*rr)[k::syncable_interface()] && (*rr)[k::syncable_interface()]->sync())
{
Lock l(mutex);
task->on_sync_succeed(r);
diff --git a/paludis/syncer.cc b/paludis/syncer.cc
index 6cad43d..beb4c28 100644
--- a/paludis/syncer.cc
+++ b/paludis/syncer.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
* Copyright (c) 2006 Stephen Klimaszewski
* Copyright (c) 2007 David Leverton
*
@@ -28,12 +28,11 @@
#include <paludis/util/join.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/kc.hh>
#include <list>
using namespace paludis;
-#include <paludis/syncer-sr.cc>
-
NoSuchSyncerError::NoSuchSyncerError(const std::string & format) throw () :
SyncFailedError("No such syncer for format '" + format + "'")
{
@@ -49,8 +48,10 @@ SyncFailedError::SyncFailedError(const std::string & msg) throw () :
{
}
-DefaultSyncer::DefaultSyncer(const SyncerParams & params)
- : _local(params.local), _remote(params.remote), _environment(params.environment)
+DefaultSyncer::DefaultSyncer(const SyncerParams & params) :
+ _local(params[k::local()]),
+ _remote(params[k::remote()]),
+ _environment(params[k::environment()])
{
std::string::size_type p(_remote.find("://")), q(_remote.find(":"));
if (std::string::npos == p)
@@ -90,21 +91,33 @@ DefaultSyncer::sync(const SyncOptions & opts) const
tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(_environment->fetchers_dirs());
tr1::shared_ptr<const FSEntrySequence> syncers_dirs(_environment->syncers_dirs());
- Command cmd(Command(stringify(_syncer) + " " + opts.options + " '" + _local + "' '" + _remote + "'")
+ Command cmd(Command(stringify(_syncer) + " " + opts[k::options()] + " '" + _local + "' '" + _remote + "'")
.with_setenv("PALUDIS_ACTION", "sync")
.with_setenv("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "))
.with_setenv("PALUDIS_FETCHERS_DIRS", join(fetchers_dirs->begin(), fetchers_dirs->end(), " "))
.with_setenv("PALUDIS_SYNCERS_DIRS", join(syncers_dirs->begin(), syncers_dirs->end(), " "))
.with_setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
- .with_setenv("PALUDIS_SYNC_FILTER_FILE", stringify(opts.filter_file)));
+ .with_setenv("PALUDIS_SYNC_FILTER_FILE", stringify(opts[k::filter_file()])));
- if (! opts.output_prefix.empty())
+ if (! opts[k::output_prefix()].empty())
cmd
- .with_stdout_prefix(opts.output_prefix)
- .with_stderr_prefix(opts.output_prefix)
+ .with_stdout_prefix(opts[k::output_prefix()])
+ .with_stderr_prefix(opts[k::output_prefix()])
.with_prefix_blank_lines();
if (run_command(cmd))
throw SyncFailedError(_local, _remote);
}
+Syncer::Syncer()
+{
+}
+
+Syncer::~Syncer()
+{
+}
+
+DefaultSyncer::~DefaultSyncer()
+{
+}
+
diff --git a/paludis/syncer.hh b/paludis/syncer.hh
index f985077..69cd1d3 100644
--- a/paludis/syncer.hh
+++ b/paludis/syncer.hh
@@ -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
@@ -21,6 +21,8 @@
#define PALUDIS_GUARD_PALUDIS_SYNCER_HH 1
#include <paludis/util/exception.hh>
+#include <paludis/util/kc-fwd.hh>
+#include <paludis/util/keys.hh>
#include <paludis/repository.hh>
#include <string>
@@ -37,8 +39,31 @@
namespace paludis
{
+ /**
+ * Options used by Syncer.
+ *
+ * \see Syncer
+ * \ingroup g_repository
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::options, std::string>,
+ kc::Field<k::filter_file, FSEntry>,
+ kc::Field<k::output_prefix, std::string>
+ > SyncOptions;
-#include <paludis/syncer-sr.hh>
+ /**
+ * Parameters for a Syncer.
+ *
+ * \see Syncer
+ * \ingroup g_repository
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::local, std::string>,
+ kc::Field<k::remote, std::string>,
+ kc::Field<k::environment, const Environment *>
+ > SyncerParams;
/**
* A Syncer subclass handles syncing Repository instances.
@@ -52,17 +77,13 @@ namespace paludis
/**
* Constructor.
*/
- Syncer()
- {
- }
+ Syncer();
public:
/**
* Destructor.
*/
- virtual ~Syncer()
- {
- }
+ virtual ~Syncer();
/**
* Perform the sync.
@@ -93,9 +114,7 @@ namespace paludis
/**
* Destructor.
*/
- virtual ~DefaultSyncer()
- {
- }
+ virtual ~DefaultSyncer();
/**
* Perform the sync.
diff --git a/paludis/syncer.sr b/paludis/syncer.sr
deleted file mode 100644
index b5d6557..0000000
--- a/paludis/syncer.sr
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-make_class_SyncOptions()
-{
- visible
-
- key options std::string
- key filter_file FSEntry
- key output_prefix std::string
-
- doxygen_comment << "END"
- /**
- * Options used by Syncer.
- *
- * \see Syncer
- * \ingroup g_repository
- * \nosubgrouping
- */
-END
-}
-
-make_class_SyncerParams()
-{
- visible
-
- key local std::string
- key remote std::string
-
- key environment "const Environment *"
-
- doxygen_comment << "END"
- /**
- * Parameters for a Syncer.
- *
- * \see Syncer
- * \ingroup g_repository
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
diff --git a/paludis/uninstall_task.cc b/paludis/uninstall_task.cc
index 490da8f..1b5dd66 100644
--- a/paludis/uninstall_task.cc
+++ b/paludis/uninstall_task.cc
@@ -411,8 +411,8 @@ UninstallTask::world_remove_set(const SetName & s)
for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
r_end(_imp->env->package_database()->end_repositories()) ;
r != r_end ; ++r)
- if ((*r)->world_interface)
- (*r)->world_interface->remove_from_world(s);
+ if ((**r)[k::world_interface()])
+ (**r)[k::world_interface()]->remove_from_world(s);
on_update_world(s);
}
@@ -441,8 +441,8 @@ namespace
for (PackageDatabase::RepositoryConstIterator r(env->package_database()->begin_repositories()),
r_end(env->package_database()->end_repositories()) ;
r != r_end ; ++r)
- if ((*r)->world_interface && a.package_ptr())
- (*r)->world_interface->remove_from_world(*a.package_ptr());
+ if ((**r)[k::world_interface()] && a.package_ptr())
+ (**r)[k::world_interface()]->remove_from_world(*a.package_ptr());
task->on_update_world(a);
}
diff --git a/paludis/util/keys.hh b/paludis/util/keys.hh
index 38555f3..67cb16b 100644
--- a/paludis/util/keys.hh
+++ b/paludis/util/keys.hh
@@ -68,6 +68,33 @@ namespace paludis
typedef kc::Key<40> config_protect;
typedef kc::Key<41> config_protect_mask;
typedef kc::Key<42> package_id;
+ typedef kc::Key<43> sets_interface;
+ typedef kc::Key<44> syncable_interface;
+ typedef kc::Key<45> use_interface;
+ typedef kc::Key<46> world_interface;
+ typedef kc::Key<47> mirrors_interface;
+ typedef kc::Key<48> environment_variable_interface;
+ typedef kc::Key<49> provides_interface;
+ typedef kc::Key<50> virtuals_interface;
+ typedef kc::Key<51> make_virtuals_interface;
+ typedef kc::Key<52> destination_interface;
+ typedef kc::Key<53> e_interface;
+ typedef kc::Key<54> hook_interface;
+ typedef kc::Key<55> qa_interface;
+ typedef kc::Key<56> manifest_interface;
+ typedef kc::Key<57> path;
+ typedef kc::Key<58> arch;
+ typedef kc::Key<59> status;
+ typedef kc::Key<60> profile;
+ typedef kc::Key<61> virtual_name;
+ typedef kc::Key<62> provided_by;
+ typedef kc::Key<63> provided_by_spec;
+ typedef kc::Key<64> image_dir;
+ typedef kc::Key<65> environment_file;
+ typedef kc::Key<66> filter_file;
+ typedef kc::Key<67> output_prefix;
+ typedef kc::Key<68> local;
+ typedef kc::Key<69> remote;
}
}
diff --git a/python/repository.cc b/python/repository.cc
index f479a84..7db6de7 100644
--- a/python/repository.cc
+++ b/python/repository.cc
@@ -42,67 +42,67 @@ struct RepositoryWrapper :
static RepositorySetsInterface *
get_sets_interface(const Repository & self)
{
- return self.sets_interface;
+ return self[k::sets_interface()];
}
static RepositorySyncableInterface *
get_syncable_interface(const Repository & self)
{
- return self.syncable_interface;
+ return self[k::syncable_interface()];
}
static RepositoryUseInterface *
get_use_interface(const Repository & self)
{
- return self.use_interface;
+ return self[k::use_interface()];
}
static RepositoryWorldInterface *
get_world_interface(const Repository & self)
{
- return self.world_interface;
+ return self[k::world_interface()];
}
static RepositoryMirrorsInterface *
get_mirrors_interface(const Repository & self)
{
- return self.mirrors_interface;
+ return self[k::mirrors_interface()];
}
static RepositoryEnvironmentVariableInterface *
get_environment_variable_interface(const Repository & self)
{
- return self.environment_variable_interface;
+ return self[k::environment_variable_interface()];
}
static RepositoryProvidesInterface *
get_provides_interface(const Repository & self)
{
- return self.provides_interface;
+ return self[k::provides_interface()];
}
static RepositoryVirtualsInterface *
get_virtuals_interface(const Repository & self)
{
- return self.virtuals_interface;
+ return self[k::virtuals_interface()];
}
static RepositoryDestinationInterface *
get_destination_interface(const Repository & self)
{
- return self.destination_interface;
+ return self[k::destination_interface()];
}
static RepositoryEInterface *
get_e_interface(const Repository & self)
{
- return self.e_interface;
+ return self[k::e_interface()];
}
static RepositoryQAInterface *
get_qa_interface(const Repository & self)
{
- return self.qa_interface;
+ return self[k::qa_interface()];
}
};
@@ -129,7 +129,7 @@ struct RepositoryEInterfaceWrapper
static void
my_set_profile(RepositoryEInterface & self, const RepositoryEInterface::ProfilesDescLine & pdl)
{
- self.set_profile(self.find_profile(pdl.path));
+ self.set_profile(self.find_profile(pdl[k::path()]));
}
};
@@ -284,13 +284,15 @@ void expose_repository()
"A profiles.desc line in a Repository implementing RepositoryEInterface.",
bp::no_init
)
- .add_property("path", bp::make_getter(&RepositoryEInterfaceProfilesDescLine::path,
- bp::return_value_policy<bp::return_by_value>())
+ .add_property("path",
+ &kc_getter<RepositoryEInterfaceProfilesDescLine, FSEntry, k::path>
+ )
+ .add_property("arch",
+ &kc_getter<RepositoryEInterfaceProfilesDescLine, std::string, k::arch>
+ )
+ .add_property("status",
+ &kc_getter<RepositoryEInterfaceProfilesDescLine, std::string, k::status>
)
-
- .def_readonly("arch", &RepositoryEInterfaceProfilesDescLine::arch)
-
- .def_readonly("status", &RepositoryEInterfaceProfilesDescLine::status)
;
/**
diff --git a/ruby/repository.cc b/ruby/repository.cc
index 4108480..537e2bf 100644
--- a/ruby/repository.cc
+++ b/ruby/repository.cc
@@ -385,14 +385,14 @@ namespace
*
* Returns self if the repository supports the interface, otherwise Nil.
*/
- template <typename T_, T_ * RepositoryCapabilities::* m_>
+ template <typename T_>
struct Interface
{
static VALUE fetch(VALUE self)
{
tr1::shared_ptr<Repository> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<Repository>, self_ptr);
- return ((**self_ptr).*m_) ? self : Qnil;
+ return ((**self_ptr)[T_()]) ? self : Qnil;
}
};
@@ -449,7 +449,7 @@ namespace
{
tr1::shared_ptr<Repository> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<Repository>, self_ptr);
- RepositoryUseInterface * const use_interface ((**self_ptr).use_interface);
+ RepositoryUseInterface * const use_interface ((**self_ptr)[k::use_interface()]);
if (use_interface)
{
@@ -483,9 +483,10 @@ namespace
{
tr1::shared_ptr<Repository> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<Repository>, self_ptr);
- if ((*self_ptr)->use_interface) {
+ if ((**self_ptr)[k::use_interface()])
+ {
tr1::shared_ptr<const PackageID> pid(value_to_package_id(package_id));
- char sep((*self_ptr)->use_interface->use_expand_separator(*pid));
+ char sep((**self_ptr)[k::use_interface()]->use_expand_separator(*pid));
return sep ? rb_str_new(&sep, 1) : Qnil;
}
else
@@ -513,10 +514,11 @@ namespace
{
tr1::shared_ptr<Repository> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<Repository>, self_ptr);
- if ((*self_ptr)->use_interface) {
+ if ((**self_ptr)[k::use_interface()])
+ {
UseFlagName ufn = UseFlagName(StringValuePtr(flag_name));
tr1::shared_ptr<const PackageID> pid(value_to_package_id(package_id));
- return rb_str_new2(((*self_ptr)->use_interface->describe_use_flag(ufn, *pid).c_str()));
+ return rb_str_new2(((**self_ptr)[k::use_interface()]->describe_use_flag(ufn, *pid).c_str()));
}
else
{
@@ -542,10 +544,11 @@ namespace
{
tr1::shared_ptr<Repository> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<Repository>, self_ptr);
- if ((*self_ptr)->e_interface) {
+ if ((**self_ptr)[k::e_interface()])
+ {
VALUE result(rb_ary_new());
- for (RepositoryEInterface::ProfilesConstIterator i((*self_ptr)->e_interface->begin_profiles()),
- i_end((*self_ptr)->e_interface->end_profiles()) ; i != i_end ; ++i)
+ for (RepositoryEInterface::ProfilesConstIterator i((**self_ptr)[k::e_interface()]->begin_profiles()),
+ i_end((**self_ptr)[k::e_interface()]->end_profiles()) ; i != i_end ; ++i)
{
rb_ary_push(result, profiles_desc_line_to_value(*i));
}
@@ -576,11 +579,11 @@ namespace
tr1::shared_ptr<Repository> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<Repository>, self_ptr);
- if ((*self_ptr)->e_interface)
+ if ((**self_ptr)[k::e_interface()])
{
- RepositoryEInterface::ProfilesConstIterator p((*self_ptr)->e_interface->find_profile(FSEntry(StringValuePtr(profile))));
+ RepositoryEInterface::ProfilesConstIterator p((**self_ptr)[k::e_interface()]->find_profile(FSEntry(StringValuePtr(profile))));
- if (p == (*self_ptr)->e_interface->end_profiles())
+ if (p == (**self_ptr)[k::e_interface()]->end_profiles())
return Qnil;
return profiles_desc_line_to_value(*p);
@@ -609,10 +612,10 @@ namespace
{
tr1::shared_ptr<Repository> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<Repository>, self_ptr);
- if ((*self_ptr)->e_interface)
- (*self_ptr)->e_interface->set_profile(
- (*self_ptr)->e_interface->find_profile(
- value_to_profiles_desc_line(profile).path));
+ if ((**self_ptr)[k::e_interface()])
+ (**self_ptr)[k::e_interface()]->set_profile(
+ (**self_ptr)[k::e_interface()]->find_profile(
+ value_to_profiles_desc_line(profile)[k::path()]));
return Qnil;
}
catch (const std::exception & e)
@@ -634,8 +637,8 @@ namespace
{
tr1::shared_ptr<Repository> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<Repository>, self_ptr);
- if ((*self_ptr)->e_interface)
- return rb_str_new2(((*self_ptr)->e_interface->profile_variable(StringValuePtr(var))).c_str());
+ if ((**self_ptr)[k::e_interface()])
+ return rb_str_new2(((**self_ptr)[k::e_interface()]->profile_variable(StringValuePtr(var))).c_str());
return Qnil;
}
catch (const std::exception & e)
@@ -668,7 +671,7 @@ namespace
*
* Fetch path to this ProfilesDescLine.
*/
- template <typename T_, T_ RepositoryEInterface::ProfilesDescLine::* m_>
+ template <typename, typename V_>
struct DescLineValue
{
static VALUE
@@ -676,7 +679,7 @@ namespace
{
RepositoryEInterface::ProfilesDescLine * ptr;
Data_Get_Struct(self, RepositoryEInterface::ProfilesDescLine, ptr);
- return rb_str_new2(stringify((*ptr).*m_).c_str());
+ return rb_str_new2(stringify((*ptr)[V_()]).c_str());
}
};
@@ -695,10 +698,10 @@ namespace
tr1::shared_ptr<Repository> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<Repository>, self_ptr);
#ifdef ENABLE_RUBY_QA
- if ((*self_ptr)->qa_interface)
+ if ((**self_ptr)[k::qa_interface()])
{
RubyQAReporter* qar = new RubyQAReporter(&reporter);
- (*self_ptr)->qa_interface->check_qa(*qar,
+ (**self_ptr)[k::qa_interface()]->check_qa(*qar,
value_to_qa_check_properties((ignore_if)),
value_to_qa_check_properties((ignore_unless)),
static_cast<QAMessageLevel>(NUM2INT(minumum_level)),
@@ -895,8 +898,8 @@ namespace
{
tr1::shared_ptr<Repository> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<Repository>, self_ptr);
- if ((*self_ptr)->environment_variable_interface)
- return rb_str_new2((*self_ptr)->environment_variable_interface->get_environment_variable(
+ if ((**self_ptr)[k::environment_variable_interface()])
+ return rb_str_new2((**self_ptr)[k::environment_variable_interface()]->get_environment_variable(
value_to_package_id(pid),
StringValuePtr(ev)).c_str());
return Qnil;
@@ -922,26 +925,17 @@ namespace
rb_define_method(c_repository, "package_names", RUBY_FUNC_CAST(&repository_package_names), 1);
rb_define_method(c_repository, "package_ids", RUBY_FUNC_CAST(&repository_package_ids), 1);
- rb_define_method(c_repository, "sets_interface", RUBY_FUNC_CAST((&Interface<RepositorySetsInterface,
- &Repository::sets_interface>::fetch)), 0);
- rb_define_method(c_repository, "syncable_interface", RUBY_FUNC_CAST((&Interface<RepositorySyncableInterface,
- &Repository::syncable_interface>::fetch)), 0);
- rb_define_method(c_repository, "use_interface", RUBY_FUNC_CAST((&Interface<RepositoryUseInterface,
- &Repository::use_interface>::fetch)), 0);
- rb_define_method(c_repository, "world_interface", RUBY_FUNC_CAST((&Interface<RepositoryWorldInterface,
- &Repository::world_interface>::fetch)), 0);
- rb_define_method(c_repository, "mirrors_interface", RUBY_FUNC_CAST((&Interface<RepositoryMirrorsInterface,
- &Repository::mirrors_interface>::fetch)), 0);
- rb_define_method(c_repository, "environment_variable_interface", RUBY_FUNC_CAST((&Interface<RepositoryEnvironmentVariableInterface,
- &Repository::environment_variable_interface>::fetch)), 0);
- rb_define_method(c_repository, "provides_interface", RUBY_FUNC_CAST((&Interface<RepositoryProvidesInterface,
- &Repository::provides_interface>::fetch)), 0);
- rb_define_method(c_repository, "virtuals_interface", RUBY_FUNC_CAST((&Interface<RepositoryVirtualsInterface,
- &Repository::virtuals_interface>::fetch)), 0);
- rb_define_method(c_repository, "e_interface", RUBY_FUNC_CAST((&Interface<RepositoryEInterface,
- &Repository::e_interface>::fetch)), 0);
- rb_define_method(c_repository, "qa_interface", RUBY_FUNC_CAST((&Interface<RepositoryQAInterface,
- &Repository::qa_interface>::fetch)), 0);
+ rb_define_method(c_repository, "sets_interface", RUBY_FUNC_CAST((&Interface< k::sets_interface>::fetch)), 0);
+ rb_define_method(c_repository, "syncable_interface", RUBY_FUNC_CAST((&Interface< k::syncable_interface>::fetch)), 0);
+ rb_define_method(c_repository, "use_interface", RUBY_FUNC_CAST((&Interface< k::use_interface>::fetch)), 0);
+ rb_define_method(c_repository, "world_interface", RUBY_FUNC_CAST((&Interface< k::world_interface>::fetch)), 0);
+ rb_define_method(c_repository, "mirrors_interface", RUBY_FUNC_CAST((&Interface< k::mirrors_interface>::fetch)), 0);
+ rb_define_method(c_repository, "environment_variable_interface", RUBY_FUNC_CAST((&Interface<
+ k::environment_variable_interface>::fetch)), 0);
+ rb_define_method(c_repository, "provides_interface", RUBY_FUNC_CAST((&Interface< k::provides_interface>::fetch)), 0);
+ rb_define_method(c_repository, "virtuals_interface", RUBY_FUNC_CAST((&Interface< k::virtuals_interface>::fetch)), 0);
+ rb_define_method(c_repository, "e_interface", RUBY_FUNC_CAST((&Interface< k::e_interface>::fetch)), 0);
+ rb_define_method(c_repository, "qa_interface", RUBY_FUNC_CAST((&Interface< k::qa_interface>::fetch)), 0);
rb_define_method(c_repository, "some_ids_might_support_action", RUBY_FUNC_CAST(&repository_some_ids_might_support_action), 1);
@@ -976,11 +970,11 @@ namespace
c_profiles_desc_line = rb_define_class_under(paludis_module(), "ProfilesDescLine", rb_cObject);
rb_funcall(c_profiles_desc_line, rb_intern("private_class_method"), 1, rb_str_new2("new"));
rb_define_method(c_profiles_desc_line, "path",
- RUBY_FUNC_CAST((&DescLineValue<FSEntry,&RepositoryEInterface::ProfilesDescLine::path>::fetch)), 0);
+ RUBY_FUNC_CAST((&DescLineValue<FSEntry, k::path>::fetch)), 0);
rb_define_method(c_profiles_desc_line, "arch",
- RUBY_FUNC_CAST((&DescLineValue<std::string,&RepositoryEInterface::ProfilesDescLine::arch>::fetch)), 0);
+ RUBY_FUNC_CAST((&DescLineValue<std::string, k::arch>::fetch)), 0);
rb_define_method(c_profiles_desc_line, "status",
- RUBY_FUNC_CAST((&DescLineValue<std::string,&RepositoryEInterface::ProfilesDescLine::status>::fetch)), 0);
+ RUBY_FUNC_CAST((&DescLineValue<std::string, k::status>::fetch)), 0);
/*
* Document-class: Paludis::FakeRepositoryBase
diff --git a/src/clients/adjutrix/display_default_system_resolution.cc b/src/clients/adjutrix/display_default_system_resolution.cc
index 0973b95..3b9d6c8 100644
--- a/src/clients/adjutrix/display_default_system_resolution.cc
+++ b/src/clients/adjutrix/display_default_system_resolution.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 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
@@ -125,11 +125,11 @@ int do_display_default_system_resolution(NoConfigEnvironment & env)
CommandLine::get_instance()->a_profile.end_args())
{
for (RepositoryEInterface::ProfilesConstIterator
- p(env.main_repository()->e_interface->begin_profiles()),
- p_end(env.main_repository()->e_interface->end_profiles()) ; p != p_end ; ++p)
+ p((*env.main_repository())[k::e_interface()]->begin_profiles()),
+ p_end((*env.main_repository())[k::e_interface()]->end_profiles()) ; p != p_end ; ++p)
{
- env.main_repository()->e_interface->set_profile(p);
- return_code |= display_default_system_resolution(env, p->arch + "." + p->status, p->path);
+ (*env.main_repository())[k::e_interface()]->set_profile(p);
+ return_code |= display_default_system_resolution(env, (*p)[k::arch()] + "." + (*p)[k::status()], (*p)[k::path()]);
}
}
else
@@ -138,12 +138,12 @@ int do_display_default_system_resolution(NoConfigEnvironment & env)
i_end(CommandLine::get_instance()->a_profile.end_args()) ; i != i_end ; ++i)
{
RepositoryEInterface::ProfilesConstIterator
- p(env.main_repository()->e_interface->find_profile(
+ p((*env.main_repository())[k::e_interface()]->find_profile(
env.main_repository_dir() / "profiles" / (*i)));
- if (p == env.main_repository()->e_interface->end_profiles())
+ if (p == (*env.main_repository())[k::e_interface()]->end_profiles())
throw ConfigurationError("Repository does not have a profile listed in profiles.desc matching '"
+ stringify(*i) + "'");
- env.main_repository()->e_interface->set_profile(p);
+ (*env.main_repository())[k::e_interface()]->set_profile(p);
return_code |= display_default_system_resolution(env, *i, env.main_repository_dir()
/ "profiles" / *i);
}
diff --git a/src/clients/adjutrix/downgrade_check.cc b/src/clients/adjutrix/downgrade_check.cc
index 2e60580..3bcdff7 100644
--- a/src/clients/adjutrix/downgrade_check.cc
+++ b/src/clients/adjutrix/downgrade_check.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
@@ -74,7 +74,7 @@ namespace
make_filename(const RepositoryEInterface::ProfilesConstIterator & p, bool unstable)
{
std::string result;
- FSEntry f(p->path);
+ FSEntry f((*p)[k::path()]);
while (f.basename() != "profiles" && f != FSEntry("/"))
{
result = f.basename() + (result.empty() ? "" : "_" + result);
@@ -90,7 +90,7 @@ namespace
make_desc(const RepositoryEInterface::ProfilesConstIterator & p, bool unstable)
{
std::string result;
- FSEntry f(p->path);
+ FSEntry f((*p)[k::path()]);
while (f.basename() != "profiles" && f != FSEntry("/"))
{
result = f.basename() + (result.empty() ? "" : "/" + result);
@@ -167,13 +167,13 @@ do_build_downgrade_check_list(NoConfigEnvironment & env)
throw ConfigurationError("Output directory already exists");
for (RepositoryEInterface::ProfilesConstIterator
- p(env.main_repository()->e_interface->begin_profiles()),
- p_end(env.main_repository()->e_interface->end_profiles()) ; p != p_end ; ++p)
+ p((*env.main_repository())[k::e_interface()]->begin_profiles()),
+ p_end((*env.main_repository())[k::e_interface()]->end_profiles()) ; p != p_end ; ++p)
{
for (int i = 0 ; i < 2 ; ++i)
{
env.set_accept_unstable(i);
- env.main_repository()->e_interface->set_profile(p);
+ (*env.main_repository())[k::e_interface()]->set_profile(p);
std::string n(make_filename(p, i));
std::cerr << "Generating " << n << "..." << std::endl;
std::ofstream f(stringify(output_dir / n).c_str());
@@ -200,13 +200,13 @@ do_downgrade_check(NoConfigEnvironment & env)
std::multimap<QPNS, std::string> results;
for (RepositoryEInterface::ProfilesConstIterator
- p(env.main_repository()->e_interface->begin_profiles()),
- p_end(env.main_repository()->e_interface->end_profiles()) ; p != p_end ; ++p)
+ p((*env.main_repository())[k::e_interface()]->begin_profiles()),
+ p_end((*env.main_repository())[k::e_interface()]->end_profiles()) ; p != p_end ; ++p)
{
for (int i = 0 ; i < 2 ; ++i)
{
env.set_accept_unstable(i);
- env.main_repository()->e_interface->set_profile(p);
+ (*env.main_repository())[k::e_interface()]->set_profile(p);
std::string n(make_filename(p, i)), desc(make_desc(p, i));
if ((before_dir / n).exists() && (after_dir / n).exists())
diff --git a/src/clients/adjutrix/find_insecure_packages.cc b/src/clients/adjutrix/find_insecure_packages.cc
index 0b26760..2902535 100644
--- a/src/clients/adjutrix/find_insecure_packages.cc
+++ b/src/clients/adjutrix/find_insecure_packages.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
@@ -158,12 +158,12 @@ void do_find_insecure_packages(const NoConfigEnvironment & env)
if (env.master_repository() && r->name() == env.master_repository()->name())
continue;
- if (! r->sets_interface)
+ if (! (*r)[k::sets_interface()])
continue;
write_repository_header(r->name());
- tr1::shared_ptr<const SetSpecTree::ConstItem> all_insecure(r->sets_interface->package_set(SetName("insecurity")));
+ tr1::shared_ptr<const SetSpecTree::ConstItem> all_insecure((*r)[k::sets_interface()]->package_set(SetName("insecurity")));
if (! all_insecure)
continue;
ListInsecureVisitor v(env);
diff --git a/src/clients/adjutrix/find_unused_packages.cc b/src/clients/adjutrix/find_unused_packages.cc
index ae60b21..04d52c1 100644
--- a/src/clients/adjutrix/find_unused_packages.cc
+++ b/src/clients/adjutrix/find_unused_packages.cc
@@ -51,7 +51,7 @@ void do_find_unused_packages(const NoConfigEnvironment & env)
if (env.master_repository() && r->name() == env.master_repository()->name())
continue;
- if (! r->use_interface)
+ if (! (*r)[k::use_interface()])
continue;
Context repo_context("When searching for unused packages in repository '" + stringify(r->name()) + "':");
diff --git a/src/clients/adjutrix/keywords_graph.cc b/src/clients/adjutrix/keywords_graph.cc
index 466f6f7..e309c7d 100644
--- a/src/clients/adjutrix/keywords_graph.cc
+++ b/src/clients/adjutrix/keywords_graph.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
@@ -80,10 +80,10 @@ namespace
if (packages->empty())
return;
- if (! repo.use_interface)
+ if (! repo[k::use_interface()])
throw InternalError(PALUDIS_HERE, "Repository has no use_interface");
- tr1::shared_ptr<const UseFlagNameSet> arch_flags(repo.use_interface->arch_flags());
+ tr1::shared_ptr<const UseFlagNameSet> arch_flags(repo[k::use_interface()]->arch_flags());
if (arch_flags->empty())
return;
diff --git a/src/clients/adjutrix/what_needs_keywording.cc b/src/clients/adjutrix/what_needs_keywording.cc
index 0fe4e4f..2a442b2 100644
--- a/src/clients/adjutrix/what_needs_keywording.cc
+++ b/src/clients/adjutrix/what_needs_keywording.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 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
@@ -68,7 +68,7 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
UseFlagName target_arch(strip_leading_string(
*CommandLine::get_instance()->begin_parameters(), "~"));
- env.main_repository()->e_interface->set_profile_by_arch(target_arch);
+ (*env.main_repository())[k::e_interface()]->set_profile_by_arch(target_arch);
env.set_accept_unstable('~' == stringify(target_keyword).at(0));
DepListOptions d_options;
diff --git a/src/clients/gtkpaludis/libgtkpaludis/repository_buttons.cc b/src/clients/gtkpaludis/libgtkpaludis/repository_buttons.cc
index 2a63ca1..b38f106 100644
--- a/src/clients/gtkpaludis/libgtkpaludis/repository_buttons.cc
+++ b/src/clients/gtkpaludis/libgtkpaludis/repository_buttons.cc
@@ -65,7 +65,7 @@ RepositoryButtons::set_repository_in_paludis_thread(const RepositoryName & name)
{
_imp->main_window->gui_thread_action(
sigc::bind(sigc::mem_fun(this, &RepositoryButtons::set_repository_in_gui_thread),
- 0 != _imp->main_window->environment()->package_database()->fetch_repository(name)->syncable_interface));
+ 0 != (*_imp->main_window->environment()->package_database()->fetch_repository(name))[k::syncable_interface()]));
}
void
diff --git a/src/clients/gtkpaludis/libgtkpaludis/sets_list_model.cc b/src/clients/gtkpaludis/libgtkpaludis/sets_list_model.cc
index eed33df..8827753 100644
--- a/src/clients/gtkpaludis/libgtkpaludis/sets_list_model.cc
+++ b/src/clients/gtkpaludis/libgtkpaludis/sets_list_model.cc
@@ -62,7 +62,7 @@ SetsListModel::populate_in_paludis_thread()
for (RepositoryNameSequence::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
{
- RepositorySetsInterface * const i(_imp->main_window->environment()->package_database()->fetch_repository(*r)->sets_interface);
+ RepositorySetsInterface * const i((*_imp->main_window->environment()->package_database()->fetch_repository(*r))[k::sets_interface()]);
if (i)
{
tr1::shared_ptr<const SetNameSet> sets(i->sets_list());
@@ -77,7 +77,7 @@ SetsListModel::populate_in_paludis_thread()
r_end(indirect_iterator(_imp->main_window->environment()->package_database()->end_repositories())) ;
r != r_end ; ++r)
{
- RepositorySetsInterface * const i(r->sets_interface);
+ RepositorySetsInterface * const i((*r)[k::sets_interface()]);
if (i)
{
tr1::shared_ptr<const SetNameSet> sets(i->sets_list());
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index 05b57b6..a382532 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.cc
@@ -287,7 +287,7 @@ int do_environment_variable(tr1::shared_ptr<Environment> env)
if (entries->empty())
throw NoSuchPackageError(spec_str);
- RepositoryEnvironmentVariableInterface * env_if((*entries->last())->repository()->environment_variable_interface);
+ RepositoryEnvironmentVariableInterface * env_if((*(*entries->last())->repository())[k::environment_variable_interface()]);
if (! env_if)
{
diff --git a/src/clients/paludis/list.cc b/src/clients/paludis/list.cc
index a0a3473..84452d1 100644
--- a/src/clients/paludis/list.cc
+++ b/src/clients/paludis/list.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
@@ -201,7 +201,7 @@ do_list_sets(tr1::shared_ptr<Environment> env)
r(env->package_database()->begin_repositories()), r_end(env->package_database()->end_repositories()) ;
r != r_end ; ++r)
{
- if (r->sets_interface == 0)
+ if ((*r)[k::sets_interface()] == 0)
continue;
if (CommandLine::get_instance()->a_repository.specified())
@@ -217,7 +217,7 @@ do_list_sets(tr1::shared_ptr<Environment> env)
r->format_key() ? r->format_key()->value() : "?"))
continue;
- tr1::shared_ptr<const SetNameSet> set_names(r->sets_interface->sets_list());
+ tr1::shared_ptr<const SetNameSet> set_names((*r)[k::sets_interface()]->sets_list());
for (SetNameSet::ConstIterator s(set_names->begin()), s_end(set_names->end()) ;
s != s_end ; ++s)
sets[*s].push_back(stringify(r->name()));
diff --git a/src/clients/qualudis/qualudis.cc b/src/clients/qualudis/qualudis.cc
index 416fefa..bfc9484 100644
--- a/src/clients/qualudis/qualudis.cc
+++ b/src/clients/qualudis/qualudis.cc
@@ -337,13 +337,13 @@ int main(int argc, char *argv[])
.extra_params(tr1::shared_ptr<Map<std::string, std::string> >())
));
- if (! env->main_repository()->qa_interface)
+ if (! (*env->main_repository())[k::qa_interface()])
throw ConfigurationError("Repository '" + stringify(env->main_repository()->name()) + "' does not support QA checks");
QualudisReporter r(QualudisCommandLine::get_instance()->a_show_associated_keys.argument());
if (QualudisCommandLine::get_instance()->empty())
{
- env->main_repository()->qa_interface->check_qa(
+ (*env->main_repository())[k::qa_interface()]->check_qa(
r,
QACheckProperties(),
QACheckProperties(),
@@ -355,7 +355,7 @@ int main(int argc, char *argv[])
for (QualudisCommandLine::ParametersConstIterator c(QualudisCommandLine::get_instance()->begin_parameters()),
c_end(QualudisCommandLine::get_instance()->end_parameters()) ;
c != c_end ; ++c)
- env->main_repository()->qa_interface->check_qa(
+ (*env->main_repository())[k::qa_interface()]->check_qa(
r,
QACheckProperties(),
QACheckProperties(),
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index 5231835..949054a 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -1127,7 +1127,7 @@ ConsoleInstallTask::_add_descriptions(tr1::shared_ptr<const UseFlagNameSet> c,
f != f_end ; ++f)
{
std::string d;
- const RepositoryUseInterface * const i(p->repository()->use_interface);
+ const RepositoryUseInterface * const i((*p->repository())[k::use_interface()]);
if (i)
d = i->describe_use_flag(*f, *p);