aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/virtuals
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-27 22:08:29 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-28 15:31:18 +0000
commitbf9e33c1c76c2c2387ada7ae7294efa21a1c2f2f (patch)
treefe00ac0ca9434b268499b6380220140fc5e1a816 /paludis/repositories/virtuals
parent761f72d25876dac3e239fad163123d35cacda4a0 (diff)
downloadpaludis-bf9e33c1c76c2c2387ada7ae7294efa21a1c2f2f.tar.gz
paludis-bf9e33c1c76c2c2387ada7ae7294efa21a1c2f2f.tar.xz
Allow repos to return partial results if faster
Diffstat (limited to 'paludis/repositories/virtuals')
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc12
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.hh13
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc12
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.hh14
-rw-r--r--paludis/repositories/virtuals/virtuals_repository_TEST.cc14
5 files changed, 34 insertions, 31 deletions
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 8d22042fa..06f223bc9 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -163,7 +163,7 @@ InstalledVirtualsRepository::need_ids() const
}
std::shared_ptr<const PackageIDSequence>
-InstalledVirtualsRepository::package_ids(const QualifiedPackageName & q) const
+InstalledVirtualsRepository::package_ids(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const
{
if (q.category().value() != "virtual")
return std::make_shared<PackageIDSequence>();
@@ -178,7 +178,7 @@ InstalledVirtualsRepository::package_ids(const QualifiedPackageName & q) const
}
std::shared_ptr<const QualifiedPackageNameSet>
-InstalledVirtualsRepository::package_names(const CategoryNamePart & c) const
+InstalledVirtualsRepository::package_names(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
if (c.value() != "virtual")
return std::make_shared<QualifiedPackageNameSet>();
@@ -193,7 +193,7 @@ InstalledVirtualsRepository::package_names(const CategoryNamePart & c) const
}
std::shared_ptr<const CategoryNamePartSet>
-InstalledVirtualsRepository::category_names() const
+InstalledVirtualsRepository::category_names(const RepositoryContentMayExcludes &) const
{
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("virtual"));
@@ -201,7 +201,7 @@ InstalledVirtualsRepository::category_names() const
}
bool
-InstalledVirtualsRepository::has_package_named(const QualifiedPackageName & q) const
+InstalledVirtualsRepository::has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const
{
if (q.category().value() != "virtual")
return false;
@@ -212,7 +212,7 @@ InstalledVirtualsRepository::has_package_named(const QualifiedPackageName & q) c
}
bool
-InstalledVirtualsRepository::has_category_named(const CategoryNamePart & c) const
+InstalledVirtualsRepository::has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return (c.value() == "virtual");
}
@@ -304,7 +304,7 @@ InstalledVirtualsRepository::some_ids_might_not_be_masked() const
}
std::shared_ptr<const CategoryNamePartSet>
-InstalledVirtualsRepository::unimportant_category_names() const
+InstalledVirtualsRepository::unimportant_category_names(const RepositoryContentMayExcludes &) const
{
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("virtual"));
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.hh b/paludis/repositories/virtuals/installed_virtuals_repository.hh
index 615e6f9c5..d946e217c 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.hh
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.hh
@@ -73,7 +73,8 @@ namespace paludis
///\}
- virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names() const;
+ virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names(
+ const RepositoryContentMayExcludes &) const;
virtual void invalidate();
@@ -89,20 +90,20 @@ namespace paludis
/* Repository */
virtual std::shared_ptr<const PackageIDSequence> package_ids(
- const QualifiedPackageName &) const
+ const QualifiedPackageName &, const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::shared_ptr<const QualifiedPackageNameSet> package_names(
- const CategoryNamePart &) const
+ const CategoryNamePart &, const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const CategoryNamePartSet> category_names() const
+ virtual std::shared_ptr<const CategoryNamePartSet> category_names(const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual bool has_package_named(const QualifiedPackageName &) const
+ virtual bool has_package_named(const QualifiedPackageName &, const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual bool has_category_named(const CategoryNamePart &) const
+ virtual bool has_category_named(const CategoryNamePart &, const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool some_ids_might_support_action(const SupportsActionTestBase &) const;
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 8d9340f6c..c2270aed2 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -248,7 +248,7 @@ VirtualsRepository::need_ids() const
}
std::shared_ptr<const PackageIDSequence>
-VirtualsRepository::package_ids(const QualifiedPackageName & q) const
+VirtualsRepository::package_ids(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const
{
if (q.category().value() != "virtual")
return std::make_shared<PackageIDSequence>();
@@ -263,7 +263,7 @@ VirtualsRepository::package_ids(const QualifiedPackageName & q) const
}
std::shared_ptr<const QualifiedPackageNameSet>
-VirtualsRepository::package_names(const CategoryNamePart & c) const
+VirtualsRepository::package_names(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
if (c.value() != "virtual")
return std::make_shared<QualifiedPackageNameSet>();
@@ -278,7 +278,7 @@ VirtualsRepository::package_names(const CategoryNamePart & c) const
}
std::shared_ptr<const CategoryNamePartSet>
-VirtualsRepository::category_names() const
+VirtualsRepository::category_names(const RepositoryContentMayExcludes &) const
{
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("virtual"));
@@ -286,7 +286,7 @@ VirtualsRepository::category_names() const
}
bool
-VirtualsRepository::has_package_named(const QualifiedPackageName & q) const
+VirtualsRepository::has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const
{
if (q.category().value() != "virtual")
return false;
@@ -304,7 +304,7 @@ VirtualsRepository::has_package_named(const QualifiedPackageName & q) const
}
bool
-VirtualsRepository::has_category_named(const CategoryNamePart & c) const
+VirtualsRepository::has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return (c.value() == "virtual");
}
@@ -405,7 +405,7 @@ VirtualsRepository::some_ids_might_not_be_masked() const
}
std::shared_ptr<const CategoryNamePartSet>
-VirtualsRepository::unimportant_category_names() const
+VirtualsRepository::unimportant_category_names(const RepositoryContentMayExcludes &) const
{
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("virtual"));
diff --git a/paludis/repositories/virtuals/virtuals_repository.hh b/paludis/repositories/virtuals/virtuals_repository.hh
index 048bc9e3d..e1029609a 100644
--- a/paludis/repositories/virtuals/virtuals_repository.hh
+++ b/paludis/repositories/virtuals/virtuals_repository.hh
@@ -73,7 +73,8 @@ namespace paludis
///\}
- virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names() const;
+ virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names(
+ const RepositoryContentMayExcludes &) const;
virtual void invalidate();
@@ -86,20 +87,21 @@ namespace paludis
/* Repository */
virtual std::shared_ptr<const PackageIDSequence> package_ids(
- const QualifiedPackageName &) const
+ const QualifiedPackageName &, const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::shared_ptr<const QualifiedPackageNameSet> package_names(
- const CategoryNamePart &) const
+ const CategoryNamePart &, const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const CategoryNamePartSet> category_names() const
+ virtual std::shared_ptr<const CategoryNamePartSet> category_names(
+ const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual bool has_package_named(const QualifiedPackageName &) const
+ virtual bool has_package_named(const QualifiedPackageName &, const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual bool has_category_named(const CategoryNamePart &) const
+ virtual bool has_category_named(const CategoryNamePart &, const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool some_ids_might_support_action(const SupportsActionTestBase &) const;
diff --git a/paludis/repositories/virtuals/virtuals_repository_TEST.cc b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
index 48cbbe15a..6c27e44a3 100644
--- a/paludis/repositories/virtuals/virtuals_repository_TEST.cc
+++ b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011 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
@@ -76,8 +76,8 @@ namespace test_cases
TEST_CHECK(bool(repo->virtual_packages()));
TEST_CHECK_EQUAL(std::distance(repo->virtual_packages()->begin(), repo->virtual_packages()->end()), 1);
- TEST_CHECK(virtuals->has_category_named(CategoryNamePart("virtual")));
- TEST_CHECK(virtuals->has_package_named(QualifiedPackageName("virtual/pkg")));
+ TEST_CHECK(virtuals->has_category_named(CategoryNamePart("virtual"), { }));
+ TEST_CHECK(virtuals->has_package_named(QualifiedPackageName("virtual/pkg"), { }));
std::shared_ptr<const PackageIDSequence> r(env[selection::AllVersionsSorted(generator::All())]);
TEST_CHECK_STRINGIFY_EQUAL(join(indirect_iterator(r->begin()), indirect_iterator(r->end()), " | "),
@@ -126,8 +126,8 @@ namespace test_cases
repo2->add_virtual_package(QualifiedPackageName("virtual/foo"), std::make_shared<PackageDepSpec>(
parse_user_package_dep_spec("<=cat/pkg-1", &env, { })));
- TEST_CHECK(virtuals->has_category_named(CategoryNamePart("virtual")));
- TEST_CHECK(virtuals->has_package_named(QualifiedPackageName("virtual/pkg")));
+ TEST_CHECK(virtuals->has_category_named(CategoryNamePart("virtual"), { }));
+ TEST_CHECK(virtuals->has_package_named(QualifiedPackageName("virtual/pkg"), { }));
std::shared_ptr<const PackageIDSequence> r(env[selection::AllVersionsSorted(generator::All())]);
TEST_CHECK_STRINGIFY_EQUAL(join(indirect_iterator(r->begin()), indirect_iterator(r->end()), " | "),
@@ -167,8 +167,8 @@ namespace test_cases
repo2->add_virtual_package(QualifiedPackageName("virtual/pkg"), std::make_shared<PackageDepSpec>(
parse_user_package_dep_spec("virtual/pkg", &env, { })));
- TEST_CHECK(virtuals->has_category_named(CategoryNamePart("virtual")));
- TEST_CHECK(virtuals->has_package_named(QualifiedPackageName("virtual/pkg")));
+ TEST_CHECK(virtuals->has_category_named(CategoryNamePart("virtual"), { }));
+ TEST_CHECK(virtuals->has_package_named(QualifiedPackageName("virtual/pkg"), { }));
std::shared_ptr<const PackageIDSequence> r(env[selection::AllVersionsSorted(generator::All())]);
TEST_CHECK_STRINGIFY_EQUAL(join(indirect_iterator(r->begin()), indirect_iterator(r->end()), " | "),