aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/virtuals
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-29 21:47:08 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-08-03 21:20:26 +0100
commit77be16f5c2de2ebcd7ce78084755f83c522edc39 (patch)
tree7f46de7cf0f1cd9ec9cd2c4b342446cd0c4d567c /paludis/repositories/virtuals
parent5c42e4800f4e6edd91dc6d8cdf54afb3d1fb34df (diff)
downloadpaludis-77be16f5c2de2ebcd7ce78084755f83c522edc39.tar.gz
paludis-77be16f5c2de2ebcd7ce78084755f83c522edc39.tar.xz
Kill kc. Breaks python.
Diffstat (limited to 'paludis/repositories/virtuals')
-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.cc2
3 files changed, 46 insertions, 42 deletions
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index cc09b138f..5b5147c67 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -34,6 +34,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/make_named_values.hh>
#include <tr1/functional>
#include <tr1/unordered_map>
@@ -107,20 +108,21 @@ namespace
InstalledVirtualsRepository::InstalledVirtualsRepository(const Environment * const env,
const FSEntry & r) :
- 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::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))),
+ Repository(RepositoryName(make_name(r)), make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
+ value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
+ value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
+ value_for<n::hook_interface>(this),
+ value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
+ value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
+ value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
+ value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
+ value_for<n::sets_interface>(static_cast<RepositorySetsInterface *>(0)),
+ value_for<n::syncable_interface>(static_cast<RepositorySyncableInterface *>(0)),
+ value_for<n::use_interface>(static_cast<RepositoryUseInterface *>(0)),
+ value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
+ )),
PrivateImplementationPattern<InstalledVirtualsRepository>(
new Implementation<InstalledVirtualsRepository>(env, r)),
_imp(PrivateImplementationPattern<InstalledVirtualsRepository>::_imp)
@@ -147,21 +149,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)[k::provides_interface()])
+ if (! (**r).provides_interface())
continue;
std::tr1::shared_ptr<const RepositoryProvidesInterface::ProvidesSequence> pp(
- (**r)[k::provides_interface()]->provided_packages());
+ (**r).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)[k::virtual_name()]));
+ IDMap::iterator i(_imp->ids.find((*p).virtual_name()));
if (i == _imp->ids.end())
- i = _imp->ids.insert(std::make_pair((*p)[k::virtual_name()], make_shared_ptr(new PackageIDSequence))).first;
+ i = _imp->ids.insert(std::make_pair((*p).virtual_name(), make_shared_ptr(new PackageIDSequence))).first;
std::tr1::shared_ptr<const PackageID> id(new virtuals::VirtualsPackageID(
- _imp->env, shared_from_this(), (*p)[k::virtual_name()], (*p)[k::provided_by()], false));
+ _imp->env, shared_from_this(), (*p).virtual_name(), (*p).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 b0b0fb21a..d5ece7a67 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -40,6 +40,7 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/make_named_values.hh>
#include <tr1/functional>
#include <tr1/unordered_map>
@@ -117,20 +118,21 @@ namespace
}
VirtualsRepository::VirtualsRepository(const Environment * const env) :
- 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::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))),
+ Repository(RepositoryName("virtuals"), make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
+ value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
+ value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
+ value_for<n::hook_interface>(static_cast<RepositoryHookInterface *>(0)),
+ value_for<n::make_virtuals_interface>(this),
+ value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
+ value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
+ value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
+ value_for<n::sets_interface>(static_cast<RepositorySetsInterface *>(0)),
+ value_for<n::syncable_interface>(static_cast<RepositorySyncableInterface *>(0)),
+ value_for<n::use_interface>(static_cast<RepositoryUseInterface *>(0)),
+ value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
+ )),
PrivateImplementationPattern<VirtualsRepository>(
new Implementation<VirtualsRepository>(env)),
_imp(PrivateImplementationPattern<VirtualsRepository>::_imp)
@@ -158,15 +160,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)[k::provides_interface()])
+ if (! (**r).provides_interface())
continue;
std::tr1::shared_ptr<const RepositoryProvidesInterface::ProvidesSequence> provides(
- (**r)[k::provides_interface()]->provided_packages());
+ (**r).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)[k::virtual_name()], std::tr1::shared_ptr<const PackageDepSpec>(
- new PackageDepSpec(make_package_dep_spec().package((*p)[k::provided_by()]->name())))));
+ _imp->names.push_back(std::make_pair((*p).virtual_name(), std::tr1::shared_ptr<const PackageDepSpec>(
+ new PackageDepSpec(make_package_dep_spec().package((*p).provided_by()->name())))));
}
std::sort(_imp->names.begin(), _imp->names.end(), NamesSortComparator());
@@ -177,11 +179,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)[k::virtuals_interface()])
+ if (! (**r).virtuals_interface())
continue;
std::tr1::shared_ptr<const RepositoryVirtualsInterface::VirtualsSequence> virtuals(
- (**r)[k::virtuals_interface()]->virtual_packages());
+ (**r).virtuals_interface()->virtual_packages());
for (RepositoryVirtualsInterface::VirtualsSequence::ConstIterator v(virtuals->begin()),
v_end(virtuals->end()) ; v != v_end ; ++v)
{
@@ -189,11 +191,11 @@ VirtualsRepository::need_names() const
std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator,
std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator> p(
std::equal_range(_imp->names.begin(), _imp->names.end(),
- std::make_pair((*v)[k::virtual_name()], std::tr1::shared_ptr<const PackageDepSpec>()),
+ std::make_pair((*v).virtual_name(), std::tr1::shared_ptr<const PackageDepSpec>()),
NamesNameComparator()));
if (p.first == p.second)
- new_names.push_back(std::make_pair((*v)[k::virtual_name()], (*v)[k::provided_by_spec()]));
+ new_names.push_back(std::make_pair((*v).virtual_name(), (*v).provided_by_spec()));
}
}
diff --git a/paludis/repositories/virtuals/virtuals_repository_TEST.cc b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
index 3750bd4a8..cc6da4ecc 100644
--- a/paludis/repositories/virtuals/virtuals_repository_TEST.cc
+++ b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
@@ -53,7 +53,7 @@ namespace test_cases
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
std::tr1::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(&env, RepositoryName("installed")));
- TEST_CHECK((*repo)[k::virtuals_interface()]);
+ TEST_CHECK(repo->virtuals_interface());
env.package_database()->add_repository(2, virtuals);
env.package_database()->add_repository(3, repo);