aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/virtuals
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories/virtuals')
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc9
-rw-r--r--paludis/repositories/virtuals/package_id.cc17
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc7
-rw-r--r--paludis/repositories/virtuals/virtuals_repository_TEST.cc22
4 files changed, 26 insertions, 29 deletions
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 7d017a428..88ee2a538 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -22,9 +22,9 @@
#include <paludis/environment.hh>
#include <paludis/hook.hh>
-#include <paludis/package_database.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/action.hh>
+
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
@@ -35,6 +35,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/stringify.hh>
#include <functional>
#include <unordered_map>
@@ -137,8 +138,8 @@ InstalledVirtualsRepository::need_ids() const
/* Populate our _imp->entries. We need to iterate over each repository in
* our env's package database, see if it has a provides interface, and if it
* does create an entry for each provided package. */
- for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
- r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
+ for (auto r(_imp->env->begin_repositories()),
+ r_end(_imp->env->end_repositories()) ; r != r_end ; ++r)
{
if (! (**r).provides_interface())
continue;
@@ -353,7 +354,7 @@ InstalledVirtualsRepository::repository_factory_dependencies(
bool
InstalledVirtualsRepository::is_suitable_destination_for(const std::shared_ptr<const PackageID> & id) const
{
- auto repo(_imp->env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(_imp->env->fetch_repository(id->repository_name()));
std::string f(repo->format_key() ? repo->format_key()->value() : "");
return f == "virtuals";
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index dcad0e4b6..a2231e576 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -36,7 +36,6 @@
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
#include <paludis/mask.hh>
-#include <paludis/package_database.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/selection.hh>
@@ -387,7 +386,7 @@ namespace
void visit(const InstallAction & a)
{
SupportsActionTest<InstallAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -395,7 +394,7 @@ namespace
void visit(const UninstallAction & a)
{
SupportsActionTest<UninstallAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -403,7 +402,7 @@ namespace
void visit(const ConfigAction & a)
{
SupportsActionTest<ConfigAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -411,7 +410,7 @@ namespace
void visit(const FetchAction & a)
{
SupportsActionTest<FetchAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -419,7 +418,7 @@ namespace
void visit(const InfoAction & a)
{
SupportsActionTest<InfoAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -427,7 +426,7 @@ namespace
void visit(const PretendAction & a)
{
SupportsActionTest<PretendAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -435,7 +434,7 @@ namespace
void visit(const PretendFetchAction & a)
{
SupportsActionTest<PretendFetchAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -452,7 +451,7 @@ VirtualsPackageID::perform_action(Action & a) const
bool
VirtualsPackageID::supports_action(const SupportsActionTestBase & b) const
{
- auto repo(_imp->env->package_database()->fetch_repository(repository_name()));
+ auto repo(_imp->env->fetch_repository(repository_name()));
return repo->some_ids_might_support_action(b);
}
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index bb6026d91..1aa80ccf4 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -22,7 +22,6 @@
#include <paludis/environment.hh>
#include <paludis/match_package.hh>
-#include <paludis/package_database.hh>
#include <paludis/action.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/selection.hh>
@@ -151,8 +150,7 @@ VirtualsRepository::need_names() const
Log::get_instance()->message("virtuals.need_names", ll_debug, lc_context) << "VirtualsRepository need_names";
/* Determine our virtual name -> package mappings. */
- for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
- r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
+ for (auto r(_imp->env->begin_repositories()), r_end(_imp->env->end_repositories()) ; r != r_end ; ++r)
{
if (! (**r).provides_interface())
continue;
@@ -170,8 +168,7 @@ VirtualsRepository::need_names() const
std::vector<std::pair<QualifiedPackageName, std::shared_ptr<const PackageDepSpec> > > new_names;
- for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
- r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
+ for (auto r(_imp->env->begin_repositories()), r_end(_imp->env->end_repositories()) ; r != r_end ; ++r)
{
if (! (**r).virtuals_interface())
continue;
diff --git a/paludis/repositories/virtuals/virtuals_repository_TEST.cc b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
index e38d4a4f7..529fb40e8 100644
--- a/paludis/repositories/virtuals/virtuals_repository_TEST.cc
+++ b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
@@ -25,7 +25,6 @@
#include <paludis/environments/test/test_environment.hh>
-#include <paludis/package_database.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
@@ -37,6 +36,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/options.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/join.hh>
#include <gtest/gtest.h>
@@ -60,9 +60,9 @@ TEST(VirtualsRepository, Works)
ASSERT_TRUE(repo->virtuals_interface());
- env.package_database()->add_repository(2, virtuals);
- env.package_database()->add_repository(3, repo);
- env.package_database()->add_repository(4, installed);
+ env.add_repository(2, virtuals);
+ env.add_repository(3, repo);
+ env.add_repository(4, installed);
repo->add_version("cat", "pkg", "1")->provide_key()->set_from_string("virtual/pkg");
repo->add_version("cat", "pkg", "2")->provide_key()->set_from_string("virtual/pkg");
@@ -100,10 +100,10 @@ TEST(VirtualsRepository, Duplicates)
n::supports_uninstall() = true
)));
- env.package_database()->add_repository(2, virtuals);
- env.package_database()->add_repository(3, repo1);
- env.package_database()->add_repository(4, repo2);
- env.package_database()->add_repository(5, installed);
+ env.add_repository(2, virtuals);
+ env.add_repository(3, repo1);
+ env.add_repository(4, repo2);
+ env.add_repository(5, installed);
repo1->add_version("cat", "pkg", "1")->provide_key()->set_from_string("virtual/pkg");
repo1->add_version("cat", "pkg", "2")->provide_key()->set_from_string("virtual/pkg");
@@ -141,9 +141,9 @@ TEST(VirtualsRepository, Recursion)
n::name() = RepositoryName("repo2")
)));
- env.package_database()->add_repository(2, repo1);
- env.package_database()->add_repository(3, repo2);
- env.package_database()->add_repository(4, virtuals);
+ env.add_repository(2, repo1);
+ env.add_repository(3, repo2);
+ env.add_repository(4, virtuals);
repo1->add_version("virtual", "gkp", "1")->provide_key()->set_from_string("virtual/pkg");
repo1->add_virtual_package(QualifiedPackageName("virtual/pkg"), std::make_shared<PackageDepSpec>(