aboutsummaryrefslogtreecommitdiff
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
parent761f72d25876dac3e239fad163123d35cacda4a0 (diff)
downloadpaludis-bf9e33c1c76c2c2387ada7ae7294efa21a1c2f2f.tar.gz
paludis-bf9e33c1c76c2c2387ada7ae7294efa21a1c2f2f.tar.xz
Allow repos to return partial results if faster
-rw-r--r--doc/api/cplusplus/examples/example_repository.cc6
-rw-r--r--paludis/environments/test/test_environment.cc2
-rw-r--r--paludis/files.m42
-rw-r--r--paludis/generator.cc20
-rw-r--r--paludis/generator_handler.cc8
-rw-r--r--paludis/package_database.cc2
-rw-r--r--paludis/package_database_TEST.cc4
-rw-r--r--paludis/repositories/accounts/accounts_repository.cc16
-rw-r--r--paludis/repositories/accounts/accounts_repository.hh14
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc16
-rw-r--r--paludis/repositories/cran/cran_installed_repository.hh10
-rw-r--r--paludis/repositories/cran/cran_installed_repository_TEST.cc4
-rw-r--r--paludis/repositories/cran/cran_repository.cc16
-rw-r--r--paludis/repositories/cran/cran_repository.hh10
-rw-r--r--paludis/repositories/cran/cran_repository_TEST.cc14
-rw-r--r--paludis/repositories/e/e_installed_repository.cc2
-rw-r--r--paludis/repositories/e/e_installed_repository.hh3
-rw-r--r--paludis/repositories/e/e_repository.cc25
-rw-r--r--paludis/repositories/e/e_repository.hh14
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc80
-rw-r--r--paludis/repositories/e/exndbam_repository.cc22
-rw-r--r--paludis/repositories/e/exndbam_repository.hh18
-rw-r--r--paludis/repositories/e/exndbam_repository_TEST.cc12
-rw-r--r--paludis/repositories/e/vdb_repository.cc28
-rw-r--r--paludis/repositories/e/vdb_repository.hh13
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc26
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc6
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc18
-rw-r--r--paludis/repositories/fake/fake_repository_base.hh10
-rw-r--r--paludis/repositories/gemcutter/gemcutter_repository.cc16
-rw-r--r--paludis/repositories/gemcutter/gemcutter_repository.hh14
-rw-r--r--paludis/repositories/repository/repository_repository.cc16
-rw-r--r--paludis/repositories/repository/repository_repository.hh14
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc16
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.hh14
-rw-r--r--paludis/repositories/unpackaged/installed_id.cc2
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc14
-rw-r--r--paludis/repositories/unpackaged/installed_repository.hh12
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.cc12
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.hh12
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.cc16
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.hh14
-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
-rw-r--r--paludis/repository-fwd.hh6
-rw-r--r--paludis/repository.cc10
-rw-r--r--paludis/repository.hh23
-rw-r--r--paludis/repository.se21
-rw-r--r--paludis/repository_name_cache.cc4
-rw-r--r--python/choices_TEST.py8
-rwxr-xr-xpython/metadata_key_TEST.py6
-rwxr-xr-xpython/package_id_TEST.py8
-rw-r--r--python/repository.cc23
-rwxr-xr-xpython/repository_TEST.py48
-rw-r--r--ruby/repository.cc22
-rw-r--r--src/clients/appareo/appareo.cc4
-rw-r--r--src/clients/cave/cmd_find_candidates.cc4
-rw-r--r--src/clients/cave/cmd_import.cc2
-rw-r--r--src/clients/cave/cmd_print_categories.cc6
-rw-r--r--src/clients/cave/cmd_print_packages.cc4
63 files changed, 461 insertions, 396 deletions
diff --git a/doc/api/cplusplus/examples/example_repository.cc b/doc/api/cplusplus/examples/example_repository.cc
index 54f0681..8ae820f 100644
--- a/doc/api/cplusplus/examples/example_repository.cc
+++ b/doc/api/cplusplus/examples/example_repository.cc
@@ -59,11 +59,11 @@ int main(int argc, char * argv[])
/* Repositories support various methods for querying categories,
* packages, IDs and so on. These methods are used by
- * PackageDatabase::query, but are also sometimes of direct use to
+ * Environment::operator[], but are also sometimes of direct use to
* clients. */
- std::shared_ptr<const CategoryNamePartSet> cats((*r)->category_names());
+ std::shared_ptr<const CategoryNamePartSet> cats((*r)->category_names({ }));
cout << left << setw(30) << " Number of categories:" << " " << cats->size() << endl;
- std::shared_ptr<const PackageIDSequence> ids((*r)->package_ids(QualifiedPackageName("sys-apps/paludis")));
+ std::shared_ptr<const PackageIDSequence> ids((*r)->package_ids(QualifiedPackageName("sys-apps/paludis"), { }));
cout << left << setw(30) << " IDs for sys-apps/paludis:" << " " <<
join(indirect_iterator(ids->begin()), indirect_iterator(ids->end()), " ") << endl;
diff --git a/paludis/environments/test/test_environment.cc b/paludis/environments/test/test_environment.cc
index eb84fc6..d8fbc8a 100644
--- a/paludis/environments/test/test_environment.cc
+++ b/paludis/environments/test/test_environment.cc
@@ -128,7 +128,7 @@ TestEnvironment::fetch_package_id(const QualifiedPackageName & q,
{
using namespace std::placeholders;
- std::shared_ptr<const PackageIDSequence> ids(package_database()->fetch_repository(r)->package_ids(q));
+ std::shared_ptr<const PackageIDSequence> ids(package_database()->fetch_repository(r)->package_ids(q, { }));
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
if (v == (*i)->version())
diff --git a/paludis/files.m4 b/paludis/files.m4
index 0fae3f7..005496e 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -84,7 +84,7 @@ add(`partially_made_package_dep_spec', `hh', `cc', `fwd', `se')
add(`permitted_choice_value_parameter_values', `hh', `cc', `fwd')
add(`pretty_print_options', `hh', `cc', `fwd', `se')
add(`pretty_printer', `hh', `cc', `fwd')
-add(`repository', `hh', `fwd', `cc')
+add(`repository', `hh', `fwd', `cc', `se')
add(`repository_factory', `hh', `fwd', `cc')
add(`repository_name_cache', `hh', `cc', `test', `testscript')
add(`selection', `hh', `cc', `fwd', `test')
diff --git a/paludis/generator.cc b/paludis/generator.cc
index 056d25f..5378ae8 100644
--- a/paludis/generator.cc
+++ b/paludis/generator.cc
@@ -172,7 +172,7 @@ namespace
q != q_end ; ++q)
{
std::shared_ptr<const PackageIDSequence> id(
- env->package_database()->fetch_repository(*r)->package_ids(*q));
+ env->package_database()->fetch_repository(*r)->package_ids(*q, { }));
for (PackageIDSequence::ConstIterator i(id->begin()), i_end(id->end()) ;
i != i_end ; ++i)
if ((*i)->from_repositories_key() && ((*i)->from_repositories_key()->value()->end() !=
@@ -209,7 +209,7 @@ namespace
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
- if (env->package_database()->fetch_repository(*r)->has_category_named(name))
+ if (env->package_database()->fetch_repository(*r)->has_category_named(name, { }))
{
result->insert(name);
break;
@@ -243,7 +243,7 @@ namespace
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
- if (env->package_database()->fetch_repository(*r)->has_category_named(name.category()))
+ if (env->package_database()->fetch_repository(*r)->has_category_named(name.category(), { }))
{
result->insert(name.category());
break;
@@ -262,7 +262,7 @@ namespace
r != r_end ; ++r)
for (CategoryNamePartSet::ConstIterator c(cats->begin()), c_end(cats->end()) ;
c != c_end ; ++c)
- if (env->package_database()->fetch_repository(*r)->has_package_named(name))
+ if (env->package_database()->fetch_repository(*r)->has_package_named(name, { }))
result->insert(name);
return result;
@@ -358,7 +358,7 @@ namespace
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
- if (env->package_database()->fetch_repository(*r)->has_category_named(*spec.category_name_part_ptr()))
+ if (env->package_database()->fetch_repository(*r)->has_category_named(*spec.category_name_part_ptr(), { }))
{
result->insert(*spec.category_name_part_ptr());
break;
@@ -374,7 +374,7 @@ namespace
{
std::shared_ptr<const CategoryNamePartSet> cats(
env->package_database()->fetch_repository(*r)
- ->category_names_containing_package(*spec.package_name_part_ptr()));
+ ->category_names_containing_package(*spec.package_name_part_ptr(), { }));
std::copy(cats->begin(), cats->end(), result->inserter());
}
@@ -385,7 +385,7 @@ namespace
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
- if (env->package_database()->fetch_repository(*r)->has_category_named(spec.package_ptr()->category()))
+ if (env->package_database()->fetch_repository(*r)->has_category_named(spec.package_ptr()->category(), { }))
{
result->insert(spec.package_ptr()->category());
break;
@@ -409,7 +409,7 @@ namespace
r != r_end ; ++r)
for (CategoryNamePartSet::ConstIterator c(cats->begin()), c_end(cats->end()) ;
c != c_end ; ++c)
- if (env->package_database()->fetch_repository(*r)->has_package_named(*c + *spec.package_name_part_ptr()))
+ if (env->package_database()->fetch_repository(*r)->has_package_named(*c + *spec.package_name_part_ptr(), { }))
result->insert(*c + *spec.package_name_part_ptr());
return result;
@@ -419,7 +419,7 @@ namespace
std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
- if (env->package_database()->fetch_repository(*r)->has_package_named(*spec.package_ptr()))
+ if (env->package_database()->fetch_repository(*r)->has_package_named(*spec.package_ptr(), { }))
{
result->insert(*spec.package_ptr());
break;
@@ -445,7 +445,7 @@ namespace
q != q_end ; ++q)
{
std::shared_ptr<const PackageIDSequence> id(
- env->package_database()->fetch_repository(*r)->package_ids(*q));
+ env->package_database()->fetch_repository(*r)->package_ids(*q, { }));
for (PackageIDSequence::ConstIterator i(id->begin()), i_end(id->end()) ;
i != i_end ; ++i)
if (match_package(*env, spec, *i, from_id, options))
diff --git a/paludis/generator_handler.cc b/paludis/generator_handler.cc
index aeb5fd9..73320ed 100644
--- a/paludis/generator_handler.cc
+++ b/paludis/generator_handler.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2008, 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
@@ -55,7 +55,7 @@ AllGeneratorHandlerBase::categories(
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
{
- std::shared_ptr<const CategoryNamePartSet> cats(env->package_database()->fetch_repository(*r)->category_names());
+ std::shared_ptr<const CategoryNamePartSet> cats(env->package_database()->fetch_repository(*r)->category_names({ }));
std::copy(cats->begin(), cats->end(), result->inserter());
}
@@ -77,7 +77,7 @@ AllGeneratorHandlerBase::packages(
c != c_end ; ++c)
{
std::shared_ptr<const QualifiedPackageNameSet> pkgs(
- env->package_database()->fetch_repository(*r)->package_names(*c));
+ env->package_database()->fetch_repository(*r)->package_names(*c, { }));
std::copy(pkgs->begin(), pkgs->end(), result->inserter());
}
}
@@ -100,7 +100,7 @@ AllGeneratorHandlerBase::ids(
q != q_end ; ++q)
{
std::shared_ptr<const PackageIDSequence> i(
- env->package_database()->fetch_repository(*r)->package_ids(*q));
+ env->package_database()->fetch_repository(*r)->package_ids(*q, { }));
std::copy(i->begin(), i->end(), result->inserter());
}
}
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index 5828630..12f3c4b 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -292,7 +292,7 @@ PackageDatabase::fetch_unique_qualified_package_name(const PackageNamePart & p,
continue;
auto repo(fetch_repository(it->repository_name()));
- std::shared_ptr<const CategoryNamePartSet> unimportant_cats(repo->unimportant_category_names());
+ std::shared_ptr<const CategoryNamePartSet> unimportant_cats(repo->unimportant_category_names({ }));
bool is_important(unimportant_cats->end() == unimportant_cats->find(it->name().category()));
bool is_in_important_repo(! repo->is_unimportant());
QPNIMap::iterator i(result->insert(std::make_pair(it->name(), std::make_pair(is_important, is_in_important_repo))).first);
diff --git a/paludis/package_database_TEST.cc b/paludis/package_database_TEST.cc
index d2196cf..431be9b 100644
--- a/paludis/package_database_TEST.cc
+++ b/paludis/package_database_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 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
@@ -112,7 +112,7 @@ namespace test_cases
{
}
- std::shared_ptr<const CategoryNamePartSet> unimportant_category_names() const
+ std::shared_ptr<const CategoryNamePartSet> unimportant_category_names(const RepositoryContentMayExcludes &) const
{
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("bad-cat1"));
diff --git a/paludis/repositories/accounts/accounts_repository.cc b/paludis/repositories/accounts/accounts_repository.cc
index a84d72a..4a1fd33 100644
--- a/paludis/repositories/accounts/accounts_repository.cc
+++ b/paludis/repositories/accounts/accounts_repository.cc
@@ -296,43 +296,43 @@ AccountsRepository::is_unimportant() const
}
bool
-AccountsRepository::has_category_named(const CategoryNamePart & c) const
+AccountsRepository::has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return _imp->store->has_category_named(c);
}
bool
-AccountsRepository::has_package_named(const QualifiedPackageName & q) const
+AccountsRepository::has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const
{
return _imp->store->has_package_named(q);
}
std::shared_ptr<const CategoryNamePartSet>
-AccountsRepository::category_names() const
+AccountsRepository::category_names(const RepositoryContentMayExcludes &) const
{
return _imp->store->category_names();
}
std::shared_ptr<const CategoryNamePartSet>
-AccountsRepository::unimportant_category_names() const
+AccountsRepository::unimportant_category_names(const RepositoryContentMayExcludes &) const
{
return _imp->store->unimportant_category_names();
}
std::shared_ptr<const CategoryNamePartSet>
-AccountsRepository::category_names_containing_package(const PackageNamePart & p) const
+AccountsRepository::category_names_containing_package(const PackageNamePart & p, const RepositoryContentMayExcludes & x) const
{
- return Repository::category_names_containing_package(p);
+ return Repository::category_names_containing_package(p, x);
}
std::shared_ptr<const QualifiedPackageNameSet>
-AccountsRepository::package_names(const CategoryNamePart & c) const
+AccountsRepository::package_names(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return _imp->store->package_names(c);
}
std::shared_ptr<const PackageIDSequence>
-AccountsRepository::package_ids(const QualifiedPackageName & p) const
+AccountsRepository::package_ids(const QualifiedPackageName & p, const RepositoryContentMayExcludes &) const
{
return _imp->store->package_ids(p);
}
diff --git a/paludis/repositories/accounts/accounts_repository.hh b/paludis/repositories/accounts/accounts_repository.hh
index 78d0307..3b8aff3 100644
--- a/paludis/repositories/accounts/accounts_repository.hh
+++ b/paludis/repositories/accounts/accounts_repository.hh
@@ -120,15 +120,15 @@ namespace paludis
///\{
virtual const bool is_unimportant() const;
- virtual bool has_category_named(const CategoryNamePart & c) const;
- virtual bool has_package_named(const QualifiedPackageName & q) const;
- virtual std::shared_ptr<const CategoryNamePartSet> category_names() const;
- virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names() const;
+ virtual bool has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const;
+ virtual bool has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const CategoryNamePartSet> category_names(const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names(const RepositoryContentMayExcludes &) const;
virtual std::shared_ptr<const CategoryNamePartSet> category_names_containing_package(
- const PackageNamePart & p) const;
+ const PackageNamePart & p, const RepositoryContentMayExcludes &) const;
virtual std::shared_ptr<const QualifiedPackageNameSet> package_names(
- const CategoryNamePart & c) const;
- virtual std::shared_ptr<const PackageIDSequence> package_ids(const QualifiedPackageName & p) const;
+ const CategoryNamePart & c, const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const PackageIDSequence> package_ids(const QualifiedPackageName & p, const RepositoryContentMayExcludes &) const;
virtual bool some_ids_might_support_action(const SupportsActionTestBase &) const;
virtual bool some_ids_might_not_be_masked() const;
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index 02d46a2..e764df7 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -187,7 +187,7 @@ CRANInstalledRepository::_add_metadata_keys() const
}
bool
-CRANInstalledRepository::has_category_named(const CategoryNamePart & c) const
+CRANInstalledRepository::has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return (CategoryNamePart("cran") == c);
}
@@ -199,11 +199,11 @@ CRANInstalledRepository::is_unimportant() const
}
bool
-CRANInstalledRepository::has_package_named(const QualifiedPackageName & q) const
+CRANInstalledRepository::has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes & x) const
{
Context context("When checking for package '" + stringify(q) + "' in " + stringify(name()) + ":");
- if (! has_category_named(q.category()))
+ if (! has_category_named(q.category(), x))
return false;
need_ids();
@@ -212,7 +212,7 @@ CRANInstalledRepository::has_package_named(const QualifiedPackageName & q) const
}
std::shared_ptr<const CategoryNamePartSet>
-CRANInstalledRepository::category_names() const
+CRANInstalledRepository::category_names(const RepositoryContentMayExcludes &) const
{
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("cran"));
@@ -220,13 +220,13 @@ CRANInstalledRepository::category_names() const
}
std::shared_ptr<const QualifiedPackageNameSet>
-CRANInstalledRepository::package_names(const CategoryNamePart & c) const
+CRANInstalledRepository::package_names(const CategoryNamePart & c, const RepositoryContentMayExcludes & x) const
{
Context context("When fetching package names in category '" + stringify(c)
+ "' in " + stringify(name()) + ":");
std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
- if (! has_category_named(c))
+ if (! has_category_named(c, x))
return result;
need_ids();
@@ -238,13 +238,13 @@ CRANInstalledRepository::package_names(const CategoryNamePart & c) const
}
std::shared_ptr<const PackageIDSequence>
-CRANInstalledRepository::package_ids(const QualifiedPackageName & n) const
+CRANInstalledRepository::package_ids(const QualifiedPackageName & n, const RepositoryContentMayExcludes & x) const
{
Context context("When fetching versions of '" + stringify(n) + "' in "
+ stringify(name()) + ":");
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
- if (! has_package_named(n))
+ if (! has_package_named(n, x))
return result;
need_ids();
diff --git a/paludis/repositories/cran/cran_installed_repository.hh b/paludis/repositories/cran/cran_installed_repository.hh
index 2e3f71b..f5c3b75 100644
--- a/paludis/repositories/cran/cran_installed_repository.hh
+++ b/paludis/repositories/cran/cran_installed_repository.hh
@@ -125,20 +125,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 const bool is_unimportant() const;
diff --git a/paludis/repositories/cran/cran_installed_repository_TEST.cc b/paludis/repositories/cran/cran_installed_repository_TEST.cc
index 0f7a4b7..d7e4dd8 100644
--- a/paludis/repositories/cran/cran_installed_repository_TEST.cc
+++ b/paludis/repositories/cran/cran_installed_repository_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 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
@@ -61,7 +61,7 @@ namespace test_cases
keys->insert("builddir", "cran_installed_repository_TEST_dir/tmp");
std::shared_ptr<Repository> repo(CRANInstalledRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- TEST_CHECK(repo->has_category_named(CategoryNamePart("cran")));
+ TEST_CHECK(repo->has_category_named(CategoryNamePart("cran"), { }));
}
} test_cran_repository_installed_packages;
}
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index 3231f16..7920c2d 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -145,18 +145,18 @@ CRANRepository::_add_metadata_keys() const
}
bool
-CRANRepository::has_category_named(const CategoryNamePart & c) const
+CRANRepository::has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return "cran" == stringify(c);
}
bool
-CRANRepository::has_package_named(const QualifiedPackageName & q) const
+CRANRepository::has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes & x) const
{
Context context("When checking for package '" + stringify(q) + "' in " + stringify(name()) + ":");
Lock l(*_imp->big_nasty_mutex);
- if (! has_category_named(q.category()))
+ if (! has_category_named(q.category(), x))
return false;
need_ids();
@@ -164,7 +164,7 @@ CRANRepository::has_package_named(const QualifiedPackageName & q) const
}
std::shared_ptr<const CategoryNamePartSet>
-CRANRepository::category_names() const
+CRANRepository::category_names(const RepositoryContentMayExcludes &) const
{
Context context("When fetching category names in " + stringify(name()) + ":");
Lock l(*_imp->big_nasty_mutex);
@@ -176,14 +176,14 @@ CRANRepository::category_names() const
}
std::shared_ptr<const QualifiedPackageNameSet>
-CRANRepository::package_names(const CategoryNamePart & c) const
+CRANRepository::package_names(const CategoryNamePart & c, const RepositoryContentMayExcludes & x) const
{
Context context("When fetching package names in category '" + stringify(c)
+ "' in " + stringify(name()) + ":");
Lock l(*_imp->big_nasty_mutex);
std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
- if (! has_category_named(c))
+ if (! has_category_named(c, x))
return result;
need_ids();
@@ -195,14 +195,14 @@ CRANRepository::package_names(const CategoryNamePart & c) const
}
std::shared_ptr<const PackageIDSequence>
-CRANRepository::package_ids(const QualifiedPackageName & n) const
+CRANRepository::package_ids(const QualifiedPackageName & n, const RepositoryContentMayExcludes & x) const
{
Context context("When fetching versions of '" + stringify(n) + "' in "
+ stringify(name()) + ":");
Lock l(*_imp->big_nasty_mutex);
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
- if (! has_package_named(n))
+ if (! has_package_named(n, x))
return result;
need_ids();
diff --git a/paludis/repositories/cran/cran_repository.hh b/paludis/repositories/cran/cran_repository.hh
index f4b3041..68217e9 100644
--- a/paludis/repositories/cran/cran_repository.hh
+++ b/paludis/repositories/cran/cran_repository.hh
@@ -130,20 +130,20 @@ namespace paludis
/* Repository */
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 std::shared_ptr<const PackageIDSequence> package_ids(
- const QualifiedPackageName &) const
+ const QualifiedPackageName &, const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const bool is_unimportant() const;
diff --git a/paludis/repositories/cran/cran_repository_TEST.cc b/paludis/repositories/cran/cran_repository_TEST.cc
index 6f11f2c..144b9fb 100644
--- a/paludis/repositories/cran/cran_repository_TEST.cc
+++ b/paludis/repositories/cran/cran_repository_TEST.cc
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2006 Danny van Dyk
- * Copyright (c) 2007, 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 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
@@ -62,9 +62,9 @@ namespace test_cases
keys->insert("builddir", "cran_repository_TEST_dir/tmp");
std::shared_ptr<Repository> repo(CRANRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- TEST_CHECK(repo->has_category_named(CategoryNamePart("cran")));
- TEST_CHECK(repo->has_package_named(QualifiedPackageName("cran/testpackage1")));
- TEST_CHECK(repo->has_package_named(QualifiedPackageName("cran/testpackage2")));
+ TEST_CHECK(repo->has_category_named(CategoryNamePart("cran"), { }));
+ TEST_CHECK(repo->has_package_named(QualifiedPackageName("cran/testpackage1"), { }));
+ TEST_CHECK(repo->has_package_named(QualifiedPackageName("cran/testpackage2"), { }));
}
} test_cran_repository_packages;
@@ -82,9 +82,9 @@ namespace test_cases
keys->insert("builddir", "cran_repository_TEST_dir/tmp");
std::shared_ptr<Repository> repo(CRANRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- TEST_CHECK(repo->has_package_named(QualifiedPackageName("cran/testbundle")));
- TEST_CHECK(repo->has_package_named(QualifiedPackageName("cran/bundlepkg1")));
- TEST_CHECK(repo->has_package_named(QualifiedPackageName("cran/bundlepkg2")));
+ TEST_CHECK(repo->has_package_named(QualifiedPackageName("cran/testbundle"), { }));
+ TEST_CHECK(repo->has_package_named(QualifiedPackageName("cran/bundlepkg1"), { }));
+ TEST_CHECK(repo->has_package_named(QualifiedPackageName("cran/bundlepkg2"), { }));
}
} test_cran_repository_bundle;
}
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index 05211ef..06aebc6 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -175,7 +175,7 @@ EInstalledRepository::is_unimportant() const
}
std::shared_ptr<const CategoryNamePartSet>
-EInstalledRepository::unimportant_category_names() const
+EInstalledRepository::unimportant_category_names(const RepositoryContentMayExcludes &) const
{
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("virtual"));
diff --git a/paludis/repositories/e/e_installed_repository.hh b/paludis/repositories/e/e_installed_repository.hh
index 36df43d..3d076d7 100644
--- a/paludis/repositories/e/e_installed_repository.hh
+++ b/paludis/repositories/e/e_installed_repository.hh
@@ -74,7 +74,8 @@ namespace paludis
/* Repository */
- virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names() const;
+ virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names(
+ const RepositoryContentMayExcludes &) const;
virtual const bool is_unimportant() const;
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index eda10b2..fc839db 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -586,31 +586,31 @@ ERepository::_add_metadata_keys() const
}
bool
-ERepository::has_category_named(const CategoryNamePart & c) const
+ERepository::has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return _imp->layout->has_category_named(c);
}
bool
-ERepository::has_package_named(const QualifiedPackageName & q) const
+ERepository::has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const
{
return _imp->layout->has_package_named(q);
}
std::shared_ptr<const CategoryNamePartSet>
-ERepository::category_names() const
+ERepository::category_names(const RepositoryContentMayExcludes &) const
{
return _imp->layout->category_names();
}
std::shared_ptr<const QualifiedPackageNameSet>
-ERepository::package_names(const CategoryNamePart & c) const
+ERepository::package_names(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return _imp->layout->package_names(c);
}
std::shared_ptr<const PackageIDSequence>
-ERepository::package_ids(const QualifiedPackageName & n) const
+ERepository::package_ids(const QualifiedPackageName & n, const RepositoryContentMayExcludes &) const
{
return _imp->layout->package_ids(n);
}
@@ -962,15 +962,16 @@ ERepository::regenerate_cache() const
}
std::shared_ptr<const CategoryNamePartSet>
-ERepository::category_names_containing_package(const PackageNamePart & p) const
+ERepository::category_names_containing_package(const PackageNamePart & p,
+ const RepositoryContentMayExcludes & x) const
{
if (! _imp->names_cache->usable())
- return Repository::category_names_containing_package(p);
+ return Repository::category_names_containing_package(p, { });
std::shared_ptr<const CategoryNamePartSet> result(
_imp->names_cache->category_names_containing_package(p));
- return result ? result : Repository::category_names_containing_package(p);
+ return result ? result : Repository::category_names_containing_package(p, x);
}
const ERepositoryParams &
@@ -1017,7 +1018,7 @@ ERepository::perform_hook(const Hook & hook, const std::shared_ptr<OutputManager
}
std::shared_ptr<const CategoryNamePartSet>
-ERepository::unimportant_category_names() const
+ERepository::unimportant_category_names(const RepositoryContentMayExcludes &) const
{
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("virtual"));
@@ -1126,7 +1127,7 @@ ERepository::make_manifest(const QualifiedPackageName & qpn)
}
std::shared_ptr<const PackageIDSequence> versions;
- versions = package_ids(qpn);
+ versions = package_ids(qpn, { });
std::set<std::string> done_files;
@@ -1865,7 +1866,7 @@ ERepository::merge(const MergeParams & m)
if (! is_suitable_destination_for(m.package_id()))
throw ActionFailedError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
- auto is_replace(find_id(package_ids(m.package_id()->name()), m.package_id()->version()));
+ auto is_replace(find_id(package_ids(m.package_id()->name(), { }), m.package_id()->version()));
bool fix_mtimes(std::static_pointer_cast<const ERepositoryID>(
m.package_id())->eapi()->supported()->ebuild_options()->fix_mtimes());
@@ -1995,7 +1996,7 @@ ERepository::merge(const MergeParams & m)
}
}
- if (! has_category_named(m.package_id()->name().category()))
+ if (! has_category_named(m.package_id()->name().category(), { }))
{
SafeOFStream s(_imp->layout->categories_file(), O_CREAT | O_WRONLY | O_CLOEXEC | O_APPEND, true);
s << m.package_id()->name().category() << std::endl;
diff --git a/paludis/repositories/e/e_repository.hh b/paludis/repositories/e/e_repository.hh
index 73d1dbf..b7b2e49 100644
--- a/paludis/repositories/e/e_repository.hh
+++ b/paludis/repositories/e/e_repository.hh
@@ -121,23 +121,23 @@ 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 std::shared_ptr<const CategoryNamePartSet> category_names_containing_package(
- const PackageNamePart &) const;
+ const PackageNamePart &, const RepositoryContentMayExcludes &) const;
- 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;
@@ -152,7 +152,7 @@ namespace paludis
HookResult perform_hook(const Hook &, const std::shared_ptr<OutputManager> &)
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names() const;
+ virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names(const RepositoryContentMayExcludes &) const;
virtual const bool is_unimportant() const;
/**
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 6c0de7c..97ec8b2 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -173,10 +173,10 @@ namespace test_cases
{
TestMessageSuffix pass_suffix(stringify(pass), true);
- TEST_CHECK(repo->has_category_named(CategoryNamePart("cat-one")));
- TEST_CHECK(repo->has_category_named(CategoryNamePart("cat-two")));
- TEST_CHECK(repo->has_category_named(CategoryNamePart("cat-three")));
- TEST_CHECK(! repo->has_category_named(CategoryNamePart("cat-four")));
+ TEST_CHECK(repo->has_category_named(CategoryNamePart("cat-one"), { }));
+ TEST_CHECK(repo->has_category_named(CategoryNamePart("cat-two"), { }));
+ TEST_CHECK(repo->has_category_named(CategoryNamePart("cat-three"), { }));
+ TEST_CHECK(! repo->has_category_named(CategoryNamePart("cat-four"), { }));
}
}
} test_e_repository_has_category_named;
@@ -202,7 +202,7 @@ namespace test_cases
{
TestMessageSuffix pass_suffix(stringify(pass), true);
- std::shared_ptr<const CategoryNamePartSet> c(repo->category_names());
+ std::shared_ptr<const CategoryNamePartSet> c(repo->category_names({ }));
TEST_CHECK(c->end() != c->find(CategoryNamePart("cat-one")));
TEST_CHECK(c->end() != c->find(CategoryNamePart("cat-two")));
TEST_CHECK(c->end() != c->find(CategoryNamePart("cat-three")));
@@ -233,18 +233,18 @@ namespace test_cases
{
TestMessageSuffix pass_suffix(stringify(pass), true);
- TEST_CHECK(repo->has_package_named(QualifiedPackageName("cat-one/pkg-one")));
- TEST_CHECK(repo->has_package_named(QualifiedPackageName("cat-two/pkg-two")));
- TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-one/pkg-two")));
- TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-two/pkg-one")));
- TEST_CHECK(repo->has_package_named(QualifiedPackageName("cat-one/pkg-both")));
- TEST_CHECK(repo->has_package_named(QualifiedPackageName("cat-two/pkg-both")));
- TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-one/pkg-neither")));
- TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-two/pkg-neither")));
- TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-three/pkg-one")));
- TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-three/pkg-two")));
- TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-three/pkg-both")));
- TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-three/pkg-neither")));
+ TEST_CHECK(repo->has_package_named(QualifiedPackageName("cat-one/pkg-one"), { }));
+ TEST_CHECK(repo->has_package_named(QualifiedPackageName("cat-two/pkg-two"), { }));
+ TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-one/pkg-two"), { }));
+ TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-two/pkg-one"), { }));
+ TEST_CHECK(repo->has_package_named(QualifiedPackageName("cat-one/pkg-both"), { }));
+ TEST_CHECK(repo->has_package_named(QualifiedPackageName("cat-two/pkg-both"), { }));
+ TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-one/pkg-neither"), { }));
+ TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-two/pkg-neither"), { }));
+ TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-three/pkg-one"), { }));
+ TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-three/pkg-two"), { }));
+ TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-three/pkg-both"), { }));
+ TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-three/pkg-neither"), { }));
}
}
} test_e_repository_has_package_named;
@@ -266,26 +266,26 @@ namespace test_cases
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- repo->package_names(CategoryNamePart("cat-one"));
- repo->package_names(CategoryNamePart("cat-two"));
- repo->package_names(CategoryNamePart("cat-three"));
+ repo->package_names(CategoryNamePart("cat-one"), { });
+ repo->package_names(CategoryNamePart("cat-two"), { });
+ repo->package_names(CategoryNamePart("cat-three"), { });
for (int pass = 1 ; pass <= 2 ; ++pass)
{
TestMessageSuffix pass_suffix(stringify(pass), true);
- TEST_CHECK(repo->has_package_named(QualifiedPackageName("cat-one/pkg-one")));
- TEST_CHECK(repo->has_package_named(QualifiedPackageName("cat-two/pkg-two")));
- TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-one/pkg-two")));
- TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-two/pkg-one")));
- TEST_CHECK(repo->has_package_named(QualifiedPackageName("cat-one/pkg-both")));
- TEST_CHECK(repo->has_package_named(QualifiedPackageName("cat-two/pkg-both")));
- TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-one/pkg-neither")));
- TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-two/pkg-neither")));
- TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-three/pkg-one")));
- TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-three/pkg-two")));
- TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-three/pkg-both")));
- TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-three/pkg-neither")));
+ TEST_CHECK(repo->has_package_named(QualifiedPackageName("cat-one/pkg-one"), { }));
+ TEST_CHECK(repo->has_package_named(QualifiedPackageName("cat-two/pkg-two"), { }));
+ TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-one/pkg-two"), { }));
+ TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-two/pkg-one"), { }));
+ TEST_CHECK(repo->has_package_named(QualifiedPackageName("cat-one/pkg-both"), { }));
+ TEST_CHECK(repo->has_package_named(QualifiedPackageName("cat-two/pkg-both"), { }));
+ TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-one/pkg-neither"), { }));
+ TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-two/pkg-neither"), { }));
+ TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-three/pkg-one"), { }));
+ TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-three/pkg-two"), { }));
+ TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-three/pkg-both"), { }));
+ TEST_CHECK(! repo->has_package_named(QualifiedPackageName("cat-three/pkg-neither"), { }));
}
}
} test_e_repository_has_package_named_cached;
@@ -313,7 +313,7 @@ namespace test_cases
{
TestMessageSuffix pass_suffix(stringify(pass), true);
- names = repo->package_names(CategoryNamePart("cat-one"));
+ names = repo->package_names(CategoryNamePart("cat-one"), { });
TEST_CHECK(! names->empty());
TEST_CHECK(names->end() != names->find(QualifiedPackageName("cat-one/pkg-one")));
TEST_CHECK(names->end() != names->find(QualifiedPackageName("cat-one/pkg-both")));
@@ -321,7 +321,7 @@ namespace test_cases
TEST_CHECK(names->end() == names->find(QualifiedPackageName("cat-one/pkg-neither")));
TEST_CHECK_EQUAL(2, std::distance(names->begin(), names->end()));
- names = repo->package_names(CategoryNamePart("cat-two"));
+ names = repo->package_names(CategoryNamePart("cat-two"), { });
TEST_CHECK(! names->empty());
TEST_CHECK(names->end() == names->find(QualifiedPackageName("cat-two/pkg-one")));
TEST_CHECK(names->end() != names->find(QualifiedPackageName("cat-two/pkg-both")));
@@ -329,7 +329,7 @@ namespace test_cases
TEST_CHECK(names->end() == names->find(QualifiedPackageName("cat-two/pkg-neither")));
TEST_CHECK_EQUAL(2, std::distance(names->begin(), names->end()));
- names = repo->package_names(CategoryNamePart("cat-three"));
+ names = repo->package_names(CategoryNamePart("cat-three"), { });
TEST_CHECK(names->empty());
TEST_CHECK(names->end() == names->find(QualifiedPackageName("cat-three/pkg-one")));
TEST_CHECK(names->end() == names->find(QualifiedPackageName("cat-three/pkg-both")));
@@ -363,7 +363,7 @@ namespace test_cases
{
TestMessageSuffix pass_suffix(stringify(pass), true);
- names = repo->package_names(CategoryNamePart("cat-one"));
+ names = repo->package_names(CategoryNamePart("cat-one"), { });
TEST_CHECK(! names->empty());
TEST_CHECK(names->end() != names->find(QualifiedPackageName("cat-one/pkg-one")));
TEST_CHECK_EQUAL(1, std::distance(names->begin(), names->end()));
@@ -397,7 +397,7 @@ namespace test_cases
std::shared_ptr<const PackageIDSequence> versions;
- versions = repo->package_ids(QualifiedPackageName("cat-one/pkg-one"));
+ versions = repo->package_ids(QualifiedPackageName("cat-one/pkg-one"), { });
TEST_CHECK(! versions->empty());
TEST_CHECK_EQUAL(2, std::distance(versions->begin(), versions->end()));
TEST_CHECK(indirect_iterator(versions->end()) != std::find_if(
@@ -410,7 +410,7 @@ namespace test_cases
indirect_iterator(versions->begin()), indirect_iterator(versions->end()),
std::bind(std::equal_to<VersionSpec>(), std::bind(std::mem_fn(&PackageID::version), _1), VersionSpec("2", VersionSpecOptions()))));
- versions = repo->package_ids(QualifiedPackageName("cat-one/pkg-neither"));
+ versions = repo->package_ids(QualifiedPackageName("cat-one/pkg-neither"), { });
TEST_CHECK(versions->empty());
TEST_CHECK_EQUAL(0, std::distance(versions->begin(), versions->end()));
}
@@ -443,7 +443,7 @@ namespace test_cases
std::shared_ptr<const PackageIDSequence> versions;
- versions = repo->package_ids(QualifiedPackageName("cat-one/pkg-one"));
+ versions = repo->package_ids(QualifiedPackageName("cat-one/pkg-one"), { });
TEST_CHECK(! versions->empty());
TEST_CHECK_EQUAL(2, std::distance(versions->begin(), versions->end()));
TEST_CHECK(indirect_iterator(versions->end()) != std::find_if(
@@ -456,7 +456,7 @@ namespace test_cases
indirect_iterator(versions->begin()), indirect_iterator(versions->end()),
std::bind(std::equal_to<VersionSpec>(), std::bind(std::mem_fn(&PackageID::version), _1), VersionSpec("2", VersionSpecOptions()))));
- versions = repo->package_ids(QualifiedPackageName("cat-one/pkg-neither"));
+ versions = repo->package_ids(QualifiedPackageName("cat-one/pkg-neither"), { });
TEST_CHECK(versions->empty());
TEST_CHECK_EQUAL(0, std::distance(versions->begin(), versions->end()));
}
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 152e754..86b4c6a 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -205,7 +205,8 @@ ExndbamRepository::invalidate_masks()
}
std::shared_ptr<const PackageIDSequence>
-ExndbamRepository::package_ids(const QualifiedPackageName & q) const
+ExndbamRepository::package_ids(const QualifiedPackageName & q,
+ const RepositoryContentMayExcludes &) const
{
std::shared_ptr<NDBAMEntrySequence> entries(_imp->ndbam.entries(q));
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
@@ -224,32 +225,37 @@ ExndbamRepository::package_ids(const QualifiedPackageName & q) const
}
std::shared_ptr<const QualifiedPackageNameSet>
-ExndbamRepository::package_names(const CategoryNamePart & c) const
+ExndbamRepository::package_names(const CategoryNamePart & c,
+ const RepositoryContentMayExcludes &) const
{
return _imp->ndbam.package_names(c);
}
std::shared_ptr<const CategoryNamePartSet>
-ExndbamRepository::category_names() const
+ExndbamRepository::category_names(
+ const RepositoryContentMayExcludes &) const
{
return _imp->ndbam.category_names();
}
std::shared_ptr<const CategoryNamePartSet>
ExndbamRepository::category_names_containing_package(
- const PackageNamePart & p) const
+ const PackageNamePart & p,
+ const RepositoryContentMayExcludes &) const
{
return _imp->ndbam.category_names_containing_package(p);
}
bool
-ExndbamRepository::has_package_named(const QualifiedPackageName & q) const
+ExndbamRepository::has_package_named(const QualifiedPackageName & q,
+ const RepositoryContentMayExcludes &) const
{
return _imp->ndbam.has_package_named(q);
}
bool
-ExndbamRepository::has_category_named(const CategoryNamePart & c) const
+ExndbamRepository::has_category_named(const CategoryNamePart & c,
+ const RepositoryContentMayExcludes &) const
{
return _imp->ndbam.has_category_named(c);
}
@@ -339,7 +345,7 @@ ExndbamRepository::merge(const MergeParams & m)
std::shared_ptr<const PackageID> if_overwritten_id, if_same_name_id;
{
- std::shared_ptr<const PackageIDSequence> ids(package_ids(m.package_id()->name()));
+ std::shared_ptr<const PackageIDSequence> ids(package_ids(m.package_id()->name(), { }));
for (PackageIDSequence::ConstIterator v(ids->begin()), v_end(ids->end()) ;
v != v_end ; ++v)
{
@@ -460,7 +466,7 @@ ExndbamRepository::merge(const MergeParams & m)
if (std::static_pointer_cast<const ERepositoryID>(m.package_id())
->eapi()->supported()->ebuild_phases()->ebuild_new_upgrade_phase_order())
{
- const std::shared_ptr<const PackageIDSequence> & replace_candidates(package_ids(m.package_id()->name()));
+ const std::shared_ptr<const PackageIDSequence> & replace_candidates(package_ids(m.package_id()->name(), { }));
for (PackageIDSequence::ConstIterator it(replace_candidates->begin()),
it_end(replace_candidates->end()); it_end != it; ++it)
{
diff --git a/paludis/repositories/e/exndbam_repository.hh b/paludis/repositories/e/exndbam_repository.hh
index 5ee7237..ea9800f 100644
--- a/paludis/repositories/e/exndbam_repository.hh
+++ b/paludis/repositories/e/exndbam_repository.hh
@@ -88,24 +88,30 @@ 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 std::shared_ptr<const CategoryNamePartSet> category_names_containing_package(
- const PackageNamePart &) const
+ const PackageNamePart &,
+ 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 const bool is_unimportant() const;
diff --git a/paludis/repositories/e/exndbam_repository_TEST.cc b/paludis/repositories/e/exndbam_repository_TEST.cc
index c48ff4d..cb644bb 100644
--- a/paludis/repositories/e/exndbam_repository_TEST.cc
+++ b/paludis/repositories/e/exndbam_repository_TEST.cc
@@ -152,7 +152,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(0, exndbam_repo);
- TEST_CHECK(exndbam_repo->package_ids(QualifiedPackageName("cat/pkg"))->empty());
+ TEST_CHECK(exndbam_repo->package_ids(QualifiedPackageName("cat/pkg"), { })->empty());
{
TestMessageSuffix suffix("install eapi 1", true);
@@ -160,7 +160,7 @@ namespace test_cases
install(env, exndbam_repo, "=cat/pkg-0::postinsttest", "");
exndbam_repo->invalidate();
- std::shared_ptr<const PackageIDSequence> ids(exndbam_repo->package_ids(QualifiedPackageName("cat/pkg")));
+ std::shared_ptr<const PackageIDSequence> ids(exndbam_repo->package_ids(QualifiedPackageName("cat/pkg"), { }));
TEST_CHECK_EQUAL(join(indirect_iterator(ids->begin()), indirect_iterator(ids->end()), " "), "cat/pkg-0::installed");
}
@@ -170,7 +170,7 @@ namespace test_cases
install(env, exndbam_repo, "=cat/pkg-0::postinsttest", "");
exndbam_repo->invalidate();
- std::shared_ptr<const PackageIDSequence> ids(exndbam_repo->package_ids(QualifiedPackageName("cat/pkg")));
+ std::shared_ptr<const PackageIDSequence> ids(exndbam_repo->package_ids(QualifiedPackageName("cat/pkg"), { }));
TEST_CHECK_EQUAL(join(indirect_iterator(ids->begin()), indirect_iterator(ids->end()), " "), "cat/pkg-0::installed");
}
@@ -180,7 +180,7 @@ namespace test_cases
install(env, exndbam_repo, "=cat/pkg-0.1::postinsttest", "=cat/pkg-0::installed");
exndbam_repo->invalidate();
- std::shared_ptr<const PackageIDSequence> ids2(exndbam_repo->package_ids(QualifiedPackageName("cat/pkg")));
+ std::shared_ptr<const PackageIDSequence> ids2(exndbam_repo->package_ids(QualifiedPackageName("cat/pkg"), { }));
TEST_CHECK_EQUAL(join(indirect_iterator(ids2->begin()), indirect_iterator(ids2->end()), " "), "cat/pkg-0.1::installed");
}
@@ -201,7 +201,7 @@ namespace test_cases
install(env, exndbam_repo, "=cat/pkg-1::postinsttest", "");
exndbam_repo->invalidate();
- std::shared_ptr<const PackageIDSequence> ids(exndbam_repo->package_ids(QualifiedPackageName("cat/pkg")));
+ std::shared_ptr<const PackageIDSequence> ids(exndbam_repo->package_ids(QualifiedPackageName("cat/pkg"), { }));
TEST_CHECK_EQUAL(join(indirect_iterator(ids->begin()), indirect_iterator(ids->end()), " "), "cat/pkg-1::installed");
}
@@ -211,7 +211,7 @@ namespace test_cases
install(env, exndbam_repo, "=cat/pkg-1.1::postinsttest", "=cat/pkg-1::installed");
exndbam_repo->invalidate();
- std::shared_ptr<const PackageIDSequence> ids(exndbam_repo->package_ids(QualifiedPackageName("cat/pkg")));
+ std::shared_ptr<const PackageIDSequence> ids(exndbam_repo->package_ids(QualifiedPackageName("cat/pkg"), { }));
TEST_CHECK_EQUAL(join(indirect_iterator(ids->begin()), indirect_iterator(ids->end()), " "), "cat/pkg-1.1::installed");
}
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index c8e1954..01edb00 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -200,7 +200,7 @@ VDBRepository::_add_metadata_keys() const
}
bool
-VDBRepository::has_category_named(const CategoryNamePart & c) const
+VDBRepository::has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
Lock l(*_imp->big_nasty_mutex);
@@ -212,7 +212,7 @@ VDBRepository::has_category_named(const CategoryNamePart & c) const
}
bool
-VDBRepository::has_package_named(const QualifiedPackageName & q) const
+VDBRepository::has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const
{
Lock l(*_imp->big_nasty_mutex);
@@ -237,7 +237,7 @@ VDBRepository::is_unimportant() const
}
std::shared_ptr<const CategoryNamePartSet>
-VDBRepository::category_names() const
+VDBRepository::category_names(const RepositoryContentMayExcludes &) const
{
Lock l(*_imp->big_nasty_mutex);
@@ -254,7 +254,7 @@ VDBRepository::category_names() const
}
std::shared_ptr<const QualifiedPackageNameSet>
-VDBRepository::package_names(const CategoryNamePart & c) const
+VDBRepository::package_names(const CategoryNamePart & c, const RepositoryContentMayExcludes & x) const
{
Lock l(*_imp->big_nasty_mutex);
@@ -264,7 +264,7 @@ VDBRepository::package_names(const CategoryNamePart & c) const
std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
need_category_names();
- if (! has_category_named(c))
+ if (! has_category_named(c, x))
return std::make_shared<QualifiedPackageNameSet>();
need_package_ids(c);
@@ -273,7 +273,7 @@ VDBRepository::package_names(const CategoryNamePart & c) const
}
std::shared_ptr<const PackageIDSequence>
-VDBRepository::package_ids(const QualifiedPackageName & n) const
+VDBRepository::package_ids(const QualifiedPackageName & n, const RepositoryContentMayExcludes & x) const
{
Lock l(*_imp->big_nasty_mutex);
@@ -282,11 +282,11 @@ VDBRepository::package_ids(const QualifiedPackageName & n) const
need_category_names();
- if (! has_category_named(n.category()))
+ if (! has_category_named(n.category(), x))
return std::make_shared<PackageIDSequence>();
need_package_ids(n.category());
- if (! has_package_named(n))
+ if (! has_package_named(n, x))
return std::make_shared<PackageIDSequence>();
return _imp->ids.find(n)->second;
@@ -543,7 +543,7 @@ VDBRepository::perform_uninstall(
if (! a.options.is_overwrite())
{
- std::shared_ptr<const PackageIDSequence> ids(package_ids(id->name()));
+ std::shared_ptr<const PackageIDSequence> ids(package_ids(id->name(), { }));
bool only(true);
for (PackageIDSequence::ConstIterator it(ids->begin()),
it_end(ids->end()); it_end != it; ++it)
@@ -852,17 +852,17 @@ VDBRepository::regenerate_provides_cache() const
}
std::shared_ptr<const CategoryNamePartSet>
-VDBRepository::category_names_containing_package(const PackageNamePart & p) const
+VDBRepository::category_names_containing_package(const PackageNamePart & p, const RepositoryContentMayExcludes & x) const
{
Lock l(*_imp->big_nasty_mutex);
if (! _imp->names_cache->usable())
- return Repository::category_names_containing_package(p);
+ return Repository::category_names_containing_package(p, x);
std::shared_ptr<const CategoryNamePartSet> result(
_imp->names_cache->category_names_containing_package(p));
- return result ? result : Repository::category_names_containing_package(p);
+ return result ? result : Repository::category_names_containing_package(p, x);
}
namespace
@@ -1024,7 +1024,7 @@ VDBRepository::merge(const MergeParams & m)
if (std::static_pointer_cast<const ERepositoryID>(m.package_id())
->eapi()->supported()->ebuild_phases()->ebuild_new_upgrade_phase_order())
{
- const std::shared_ptr<const PackageIDSequence> & replace_candidates(package_ids(m.package_id()->name()));
+ const std::shared_ptr<const PackageIDSequence> & replace_candidates(package_ids(m.package_id()->name(), { }));
for (PackageIDSequence::ConstIterator it(replace_candidates->begin()),
it_end(replace_candidates->end()); it_end != it; ++it)
{
@@ -1147,7 +1147,7 @@ VDBRepository::package_id_if_exists(const QualifiedPackageName & q, const Versio
{
Lock l(*_imp->big_nasty_mutex);
- if (! has_package_named(q))
+ if (! has_package_named(q, { }))
return std::shared_ptr<const ERepositoryID>();
need_package_ids(q.category());
diff --git a/paludis/repositories/e/vdb_repository.hh b/paludis/repositories/e/vdb_repository.hh
index ec7ab4b..f027e2b 100644
--- a/paludis/repositories/e/vdb_repository.hh
+++ b/paludis/repositories/e/vdb_repository.hh
@@ -136,24 +136,25 @@ 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 std::shared_ptr<const CategoryNamePartSet> category_names_containing_package(
- const PackageNamePart &) const
+ const PackageNamePart &, 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 const bool is_unimportant() const;
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index 94712b8..2d4ec69 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -127,9 +127,9 @@ namespace test_cases
std::shared_ptr<Repository> repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- TEST_CHECK(repo->has_category_named(CategoryNamePart("cat-one")));
- TEST_CHECK(repo->has_category_named(CategoryNamePart("cat-two")));
- TEST_CHECK(! repo->has_category_named(CategoryNamePart("cat-three")));
+ TEST_CHECK(repo->has_category_named(CategoryNamePart("cat-one"), { }));
+ TEST_CHECK(repo->has_category_named(CategoryNamePart("cat-two"), { }));
+ TEST_CHECK(! repo->has_category_named(CategoryNamePart("cat-three"), { }));
}
} test_vdb_repository_has_category_named;
@@ -1177,7 +1177,7 @@ namespace test_cases
n::want_phase() = &want_all_phases
));
- TEST_CHECK(vdb_repo->package_ids(QualifiedPackageName("cat/pkg"))->empty());
+ TEST_CHECK(vdb_repo->package_ids(QualifiedPackageName("cat/pkg"), { })->empty());
{
TestMessageSuffix suffix("install", true);
@@ -1187,7 +1187,7 @@ namespace test_cases
id->perform_action(install_action);
vdb_repo->invalidate();
- std::shared_ptr<const PackageIDSequence> ids(vdb_repo->package_ids(QualifiedPackageName("cat/pkg")));
+ std::shared_ptr<const PackageIDSequence> ids(vdb_repo->package_ids(QualifiedPackageName("cat/pkg"), { }));
TEST_CHECK_EQUAL(join(indirect_iterator(ids->begin()), indirect_iterator(ids->end()), " "), "cat/pkg-1::installed");
}
@@ -1199,7 +1199,7 @@ namespace test_cases
id->perform_action(install_action);
vdb_repo->invalidate();
- std::shared_ptr<const PackageIDSequence> ids(vdb_repo->package_ids(QualifiedPackageName("cat/pkg")));
+ std::shared_ptr<const PackageIDSequence> ids(vdb_repo->package_ids(QualifiedPackageName("cat/pkg"), { }));
TEST_CHECK_EQUAL(join(indirect_iterator(ids->begin()), indirect_iterator(ids->end()), " "), "cat/pkg-1::installed");
}
@@ -1211,7 +1211,7 @@ namespace test_cases
id->perform_action(install_action);
vdb_repo->invalidate();
- std::shared_ptr<const PackageIDSequence> ids(vdb_repo->package_ids(QualifiedPackageName("cat/pkg")));
+ std::shared_ptr<const PackageIDSequence> ids(vdb_repo->package_ids(QualifiedPackageName("cat/pkg"), { }));
TEST_CHECK_EQUAL(join(indirect_iterator(ids->begin()), indirect_iterator(ids->end()), " "), "cat/pkg-1-r0::installed");
}
}
@@ -1284,7 +1284,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(0, vdb_repo);
- TEST_CHECK(vdb_repo->package_ids(QualifiedPackageName("cat/pkg"))->empty());
+ TEST_CHECK(vdb_repo->package_ids(QualifiedPackageName("cat/pkg"), { })->empty());
{
TestMessageSuffix suffix("install eapi 1", true);
@@ -1293,7 +1293,7 @@ namespace test_cases
install(env, vdb_repo, "=cat/pkg-0::postinsttest", "");
vdb_repo->invalidate();
- std::shared_ptr<const PackageIDSequence> ids(vdb_repo->package_ids(QualifiedPackageName("cat/pkg")));
+ std::shared_ptr<const PackageIDSequence> ids(vdb_repo->package_ids(QualifiedPackageName("cat/pkg"), { }));
TEST_CHECK_EQUAL(join(indirect_iterator(ids->begin()), indirect_iterator(ids->end()), " "), "cat/pkg-0::installed");
}
@@ -1304,7 +1304,7 @@ namespace test_cases
install(env, vdb_repo, "=cat/pkg-0::postinsttest", "");
vdb_repo->invalidate();
- std::shared_ptr<const PackageIDSequence> ids(vdb_repo->package_ids(QualifiedPackageName("cat/pkg")));
+ std::shared_ptr<const PackageIDSequence> ids(vdb_repo->package_ids(QualifiedPackageName("cat/pkg"), { }));
TEST_CHECK_EQUAL(join(indirect_iterator(ids->begin()), indirect_iterator(ids->end()), " "), "cat/pkg-0::installed");
}
@@ -1315,7 +1315,7 @@ namespace test_cases
install(env, vdb_repo, "=cat/pkg-0.1::postinsttest", "=cat/pkg-0::installed");
vdb_repo->invalidate();
- std::shared_ptr<const PackageIDSequence> ids2(vdb_repo->package_ids(QualifiedPackageName("cat/pkg")));
+ std::shared_ptr<const PackageIDSequence> ids2(vdb_repo->package_ids(QualifiedPackageName("cat/pkg"), { }));
TEST_CHECK_EQUAL(join(indirect_iterator(ids2->begin()), indirect_iterator(ids2->end()), " "), "cat/pkg-0.1::installed");
}
@@ -1338,7 +1338,7 @@ namespace test_cases
install(env, vdb_repo, "=cat/pkg-1::postinsttest", "");
vdb_repo->invalidate();
- std::shared_ptr<const PackageIDSequence> ids(vdb_repo->package_ids(QualifiedPackageName("cat/pkg")));
+ std::shared_ptr<const PackageIDSequence> ids(vdb_repo->package_ids(QualifiedPackageName("cat/pkg"), { }));
TEST_CHECK_EQUAL(join(indirect_iterator(ids->begin()), indirect_iterator(ids->end()), " "), "cat/pkg-1::installed");
}
@@ -1349,7 +1349,7 @@ namespace test_cases
install(env, vdb_repo, "=cat/pkg-1.1::postinsttest", "=cat/pkg-1::installed");
vdb_repo->invalidate();
- std::shared_ptr<const PackageIDSequence> ids(vdb_repo->package_ids(QualifiedPackageName("cat/pkg")));
+ std::shared_ptr<const PackageIDSequence> ids(vdb_repo->package_ids(QualifiedPackageName("cat/pkg"), { }));
TEST_CHECK_EQUAL(join(indirect_iterator(ids->begin()), indirect_iterator(ids->end()), " "), "cat/pkg-1.1::installed");
}
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index ca40eff..16c1d94 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -87,15 +87,15 @@ FakeInstalledRepository::provided_packages() const
{
std::shared_ptr<ProvidesSequence> result(std::make_shared<ProvidesSequence>());
- std::shared_ptr<const CategoryNamePartSet> cats(category_names());
+ std::shared_ptr<const CategoryNamePartSet> cats(category_names({ }));
for (CategoryNamePartSet::ConstIterator c(cats->begin()), c_end(cats->end()) ;
c != c_end ; ++c)
{
- std::shared_ptr<const QualifiedPackageNameSet> pkgs(package_names(*c));
+ std::shared_ptr<const QualifiedPackageNameSet> pkgs(package_names(*c, { }));
for (QualifiedPackageNameSet::ConstIterator p(pkgs->begin()), p_end(pkgs->end()) ;
p != p_end ; ++p)
{
- std::shared_ptr<const PackageIDSequence> vers(package_ids(*p));
+ std::shared_ptr<const PackageIDSequence> vers(package_ids(*p, { }));
for (PackageIDSequence::ConstIterator v(vers->begin()), v_end(vers->end()) ;
v != v_end ; ++v)
{
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index 6e0663a..edfc7f4 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -73,30 +73,30 @@ FakeRepositoryBase::~FakeRepositoryBase()
}
bool
-FakeRepositoryBase::has_category_named(const CategoryNamePart & c) const
+FakeRepositoryBase::has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return (_imp->category_names->end() != _imp->category_names->find(c));
}
bool
-FakeRepositoryBase::has_package_named(const QualifiedPackageName & q) const
+FakeRepositoryBase::has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes & x) const
{
- return has_category_named(q.category()) &&
+ return has_category_named(q.category(), x) &&
(_imp->package_names.find(q.category())->second->end() !=
_imp->package_names.find(q.category())->second->find(q.package()));
}
std::shared_ptr<const CategoryNamePartSet>
-FakeRepositoryBase::category_names() const
+FakeRepositoryBase::category_names(const RepositoryContentMayExcludes &) const
{
return _imp->category_names;
}
std::shared_ptr<const QualifiedPackageNameSet>
-FakeRepositoryBase::package_names(const CategoryNamePart & c) const
+FakeRepositoryBase::package_names(const CategoryNamePart & c, const RepositoryContentMayExcludes & x) const
{
std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
- if (! has_category_named(c))
+ if (! has_category_named(c, x))
return result;
PackageNamePartSet::ConstIterator p(_imp->package_names.find(c)->second->begin()),
@@ -107,11 +107,11 @@ FakeRepositoryBase::package_names(const CategoryNamePart & c) const
}
std::shared_ptr<const PackageIDSequence>
-FakeRepositoryBase::package_ids(const QualifiedPackageName & n) const
+FakeRepositoryBase::package_ids(const QualifiedPackageName & n, const RepositoryContentMayExcludes & x) const
{
- if (! has_category_named(n.category()))
+ if (! has_category_named(n.category(), x))
return std::make_shared<PackageIDSequence>();
- if (! has_package_named(n))
+ if (! has_package_named(n, x))
return std::make_shared<PackageIDSequence>();
return _imp->ids.find(n)->second;
}
diff --git a/paludis/repositories/fake/fake_repository_base.hh b/paludis/repositories/fake/fake_repository_base.hh
index 4e4d647..2abfd08 100644
--- a/paludis/repositories/fake/fake_repository_base.hh
+++ b/paludis/repositories/fake/fake_repository_base.hh
@@ -100,20 +100,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 sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
diff --git a/paludis/repositories/gemcutter/gemcutter_repository.cc b/paludis/repositories/gemcutter/gemcutter_repository.cc
index 48abd72..073949d 100644
--- a/paludis/repositories/gemcutter/gemcutter_repository.cc
+++ b/paludis/repositories/gemcutter/gemcutter_repository.cc
@@ -156,43 +156,43 @@ GemcutterRepository::invalidate_masks()
}
bool
-GemcutterRepository::has_category_named(const CategoryNamePart & c) const
+GemcutterRepository::has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return _imp->store->has_category_named(c);
}
bool
-GemcutterRepository::has_package_named(const QualifiedPackageName & q) const
+GemcutterRepository::has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const
{
return _imp->store->has_package_named(q);
}
std::shared_ptr<const CategoryNamePartSet>
-GemcutterRepository::category_names() const
+GemcutterRepository::category_names(const RepositoryContentMayExcludes &) const
{
return _imp->store->category_names();
}
std::shared_ptr<const CategoryNamePartSet>
-GemcutterRepository::unimportant_category_names() const
+GemcutterRepository::unimportant_category_names(const RepositoryContentMayExcludes &) const
{
return _imp->store->unimportant_category_names();
}
std::shared_ptr<const CategoryNamePartSet>
-GemcutterRepository::category_names_containing_package(const PackageNamePart & p) const
+GemcutterRepository::category_names_containing_package(const PackageNamePart & p, const RepositoryContentMayExcludes & x) const
{
- return Repository::category_names_containing_package(p);
+ return Repository::category_names_containing_package(p, x);
}
std::shared_ptr<const QualifiedPackageNameSet>
-GemcutterRepository::package_names(const CategoryNamePart & c) const
+GemcutterRepository::package_names(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return _imp->store->package_names(c);
}
std::shared_ptr<const PackageIDSequence>
-GemcutterRepository::package_ids(const QualifiedPackageName & p) const
+GemcutterRepository::package_ids(const QualifiedPackageName & p, const RepositoryContentMayExcludes &) const
{
return _imp->store->package_ids(p);
}
diff --git a/paludis/repositories/gemcutter/gemcutter_repository.hh b/paludis/repositories/gemcutter/gemcutter_repository.hh
index d6897c8..e2910ce 100644
--- a/paludis/repositories/gemcutter/gemcutter_repository.hh
+++ b/paludis/repositories/gemcutter/gemcutter_repository.hh
@@ -77,13 +77,13 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
- virtual bool has_category_named(const CategoryNamePart & c) const;
- virtual bool has_package_named(const QualifiedPackageName & q) const;
- virtual std::shared_ptr<const CategoryNamePartSet> category_names() const;
- virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names() const;
- virtual std::shared_ptr<const CategoryNamePartSet> category_names_containing_package(const PackageNamePart & p) const;
- virtual std::shared_ptr<const QualifiedPackageNameSet> package_names(const CategoryNamePart & c) const;
- virtual std::shared_ptr<const PackageIDSequence> package_ids(const QualifiedPackageName & p) const;
+ virtual bool has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const;
+ virtual bool has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const CategoryNamePartSet> category_names(const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names(const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const CategoryNamePartSet> category_names_containing_package(const PackageNamePart & p, const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const QualifiedPackageNameSet> package_names(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const PackageIDSequence> package_ids(const QualifiedPackageName & p, const RepositoryContentMayExcludes &) const;
virtual bool some_ids_might_support_action(const SupportsActionTestBase &) const;
virtual bool some_ids_might_not_be_masked() const;
diff --git a/paludis/repositories/repository/repository_repository.cc b/paludis/repositories/repository/repository_repository.cc
index bd30f8a..388d5c3 100644
--- a/paludis/repositories/repository/repository_repository.cc
+++ b/paludis/repositories/repository/repository_repository.cc
@@ -168,43 +168,43 @@ RepositoryRepository::invalidate_masks()
}
bool
-RepositoryRepository::has_category_named(const CategoryNamePart & c) const
+RepositoryRepository::has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return _imp->store->has_category_named(c);
}
bool
-RepositoryRepository::has_package_named(const QualifiedPackageName & q) const
+RepositoryRepository::has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const
{
return _imp->store->has_package_named(q);
}
std::shared_ptr<const CategoryNamePartSet>
-RepositoryRepository::category_names() const
+RepositoryRepository::category_names(const RepositoryContentMayExcludes &) const
{
return _imp->store->category_names();
}
std::shared_ptr<const CategoryNamePartSet>
-RepositoryRepository::unimportant_category_names() const
+RepositoryRepository::unimportant_category_names(const RepositoryContentMayExcludes &) const
{
return _imp->store->unimportant_category_names();
}
std::shared_ptr<const CategoryNamePartSet>
-RepositoryRepository::category_names_containing_package(const PackageNamePart & p) const
+RepositoryRepository::category_names_containing_package(const PackageNamePart & p, const RepositoryContentMayExcludes & x) const
{
- return Repository::category_names_containing_package(p);
+ return Repository::category_names_containing_package(p, x);
}
std::shared_ptr<const QualifiedPackageNameSet>
-RepositoryRepository::package_names(const CategoryNamePart & c) const
+RepositoryRepository::package_names(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return _imp->store->package_names(c);
}
std::shared_ptr<const PackageIDSequence>
-RepositoryRepository::package_ids(const QualifiedPackageName & p) const
+RepositoryRepository::package_ids(const QualifiedPackageName & p, const RepositoryContentMayExcludes &) const
{
return _imp->store->package_ids(p);
}
diff --git a/paludis/repositories/repository/repository_repository.hh b/paludis/repositories/repository/repository_repository.hh
index 4a7ab3c..73bea03 100644
--- a/paludis/repositories/repository/repository_repository.hh
+++ b/paludis/repositories/repository/repository_repository.hh
@@ -81,15 +81,15 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
- virtual bool has_category_named(const CategoryNamePart & c) const;
- virtual bool has_package_named(const QualifiedPackageName & q) const;
- virtual std::shared_ptr<const CategoryNamePartSet> category_names() const;
- virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names() const;
+ virtual bool has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const;
+ virtual bool has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const CategoryNamePartSet> category_names(const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names(const RepositoryContentMayExcludes &) const;
virtual std::shared_ptr<const CategoryNamePartSet> category_names_containing_package(
- const PackageNamePart & p) const;
+ const PackageNamePart & p, const RepositoryContentMayExcludes &) const;
virtual std::shared_ptr<const QualifiedPackageNameSet> package_names(
- const CategoryNamePart & c) const;
- virtual std::shared_ptr<const PackageIDSequence> package_ids(const QualifiedPackageName & p) const;
+ const CategoryNamePart & c, const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const PackageIDSequence> package_ids(const QualifiedPackageName & p, const RepositoryContentMayExcludes &) const;
virtual bool some_ids_might_support_action(const SupportsActionTestBase &) const;
virtual bool some_ids_might_not_be_masked() const;
diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc
index 7698241..522ec11 100644
--- a/paludis/repositories/unavailable/unavailable_repository.cc
+++ b/paludis/repositories/unavailable/unavailable_repository.cc
@@ -170,43 +170,43 @@ UnavailableRepository::invalidate_masks()
}
bool
-UnavailableRepository::has_category_named(const CategoryNamePart & c) const
+UnavailableRepository::has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return _imp->store->has_category_named(c);
}
bool
-UnavailableRepository::has_package_named(const QualifiedPackageName & q) const
+UnavailableRepository::has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const
{
return _imp->store->has_package_named(q);
}
std::shared_ptr<const CategoryNamePartSet>
-UnavailableRepository::category_names() const
+UnavailableRepository::category_names(const RepositoryContentMayExcludes &) const
{
return _imp->store->category_names();
}
std::shared_ptr<const CategoryNamePartSet>
-UnavailableRepository::unimportant_category_names() const
+UnavailableRepository::unimportant_category_names(const RepositoryContentMayExcludes &) const
{
return _imp->store->unimportant_category_names();
}
std::shared_ptr<const CategoryNamePartSet>
-UnavailableRepository::category_names_containing_package(const PackageNamePart & p) const
+UnavailableRepository::category_names_containing_package(const PackageNamePart & p, const RepositoryContentMayExcludes & x) const
{
- return Repository::category_names_containing_package(p);
+ return Repository::category_names_containing_package(p, x);
}
std::shared_ptr<const QualifiedPackageNameSet>
-UnavailableRepository::package_names(const CategoryNamePart & c) const
+UnavailableRepository::package_names(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return _imp->store->package_names(c);
}
std::shared_ptr<const PackageIDSequence>
-UnavailableRepository::package_ids(const QualifiedPackageName & p) const
+UnavailableRepository::package_ids(const QualifiedPackageName & p, const RepositoryContentMayExcludes &) const
{
return _imp->store->package_ids(p);
}
diff --git a/paludis/repositories/unavailable/unavailable_repository.hh b/paludis/repositories/unavailable/unavailable_repository.hh
index c05b18f..140d5c1 100644
--- a/paludis/repositories/unavailable/unavailable_repository.hh
+++ b/paludis/repositories/unavailable/unavailable_repository.hh
@@ -80,15 +80,15 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
- virtual bool has_category_named(const CategoryNamePart & c) const;
- virtual bool has_package_named(const QualifiedPackageName & q) const;
- virtual std::shared_ptr<const CategoryNamePartSet> category_names() const;
- virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names() const;
+ virtual bool has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const;
+ virtual bool has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const CategoryNamePartSet> category_names(const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names(const RepositoryContentMayExcludes &) const;
virtual std::shared_ptr<const CategoryNamePartSet> category_names_containing_package(
- const PackageNamePart & p) const;
+ const PackageNamePart & p, const RepositoryContentMayExcludes &) const;
virtual std::shared_ptr<const QualifiedPackageNameSet> package_names(
- const CategoryNamePart & c) const;
- virtual std::shared_ptr<const PackageIDSequence> package_ids(const QualifiedPackageName & p) const;
+ const CategoryNamePart & c, const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const PackageIDSequence> package_ids(const QualifiedPackageName & p, const RepositoryContentMayExcludes &) const;
virtual bool some_ids_might_support_action(const SupportsActionTestBase &) const;
virtual bool some_ids_might_not_be_masked() const;
diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc
index a6a8056..e703515 100644
--- a/paludis/repositories/unpackaged/installed_id.cc
+++ b/paludis/repositories/unpackaged/installed_id.cc
@@ -834,7 +834,7 @@ InstalledUnpackagedID::uninstall(const bool replace,
bool last((! replace) && (! if_for_install_id));
if (last)
{
- std::shared_ptr<const PackageIDSequence> ids(repo->package_ids(name()));
+ std::shared_ptr<const PackageIDSequence> ids(repo->package_ids(name(), { }));
for (PackageIDSequence::ConstIterator v(ids->begin()), v_end(ids->end()) ;
v != v_end ; ++v)
if (**v != *this)
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 66a8bd1..a2daa15 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -118,7 +118,7 @@ InstalledUnpackagedRepository::_add_metadata_keys() const
}
std::shared_ptr<const PackageIDSequence>
-InstalledUnpackagedRepository::package_ids(const QualifiedPackageName & q) const
+InstalledUnpackagedRepository::package_ids(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const
{
std::shared_ptr<NDBAMEntrySequence> entries(_imp->ndbam.entries(q));
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
@@ -137,32 +137,32 @@ InstalledUnpackagedRepository::package_ids(const QualifiedPackageName & q) const
}
std::shared_ptr<const QualifiedPackageNameSet>
-InstalledUnpackagedRepository::package_names(const CategoryNamePart & c) const
+InstalledUnpackagedRepository::package_names(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return _imp->ndbam.package_names(c);
}
std::shared_ptr<const CategoryNamePartSet>
-InstalledUnpackagedRepository::category_names() const
+InstalledUnpackagedRepository::category_names(const RepositoryContentMayExcludes &) const
{
return _imp->ndbam.category_names();
}
std::shared_ptr<const CategoryNamePartSet>
InstalledUnpackagedRepository::category_names_containing_package(
- const PackageNamePart & p) const
+ const PackageNamePart & p, const RepositoryContentMayExcludes &) const
{
return _imp->ndbam.category_names_containing_package(p);
}
bool
-InstalledUnpackagedRepository::has_package_named(const QualifiedPackageName & q) const
+InstalledUnpackagedRepository::has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const
{
return _imp->ndbam.has_package_named(q);
}
bool
-InstalledUnpackagedRepository::has_category_named(const CategoryNamePart & c) const
+InstalledUnpackagedRepository::has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return _imp->ndbam.has_category_named(c);
}
@@ -298,7 +298,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
std::shared_ptr<const PackageID> if_overwritten_id, if_same_name_id;
{
- std::shared_ptr<const PackageIDSequence> ids(package_ids(m.package_id()->name()));
+ std::shared_ptr<const PackageIDSequence> ids(package_ids(m.package_id()->name(), { }));
for (PackageIDSequence::ConstIterator v(ids->begin()), v_end(ids->end()) ;
v != v_end ; ++v)
{
diff --git a/paludis/repositories/unpackaged/installed_repository.hh b/paludis/repositories/unpackaged/installed_repository.hh
index e933704..6180fea 100644
--- a/paludis/repositories/unpackaged/installed_repository.hh
+++ b/paludis/repositories/unpackaged/installed_repository.hh
@@ -80,24 +80,24 @@ namespace paludis
void deindex(const QualifiedPackageName &) const;
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 std::shared_ptr<const CategoryNamePartSet> category_names_containing_package(
- const PackageNamePart &) const
+ const PackageNamePart &, 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/unpackaged/unpackaged_repository.cc b/paludis/repositories/unpackaged/unpackaged_repository.cc
index b3ec196..48ee616 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository.cc
@@ -127,37 +127,37 @@ UnpackagedRepository::_add_metadata_keys() const
}
std::shared_ptr<const PackageIDSequence>
-UnpackagedRepository::package_ids(const QualifiedPackageName & n) const
+UnpackagedRepository::package_ids(const QualifiedPackageName & n, const RepositoryContentMayExcludes &) const
{
return n == _imp->id->name() ? _imp->ids : std::make_shared<PackageIDSequence>();
}
std::shared_ptr<const QualifiedPackageNameSet>
-UnpackagedRepository::package_names(const CategoryNamePart & c) const
+UnpackagedRepository::package_names(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return c == _imp->id->name().category() ? _imp->package_names : std::make_shared<QualifiedPackageNameSet>();
}
std::shared_ptr<const CategoryNamePartSet>
-UnpackagedRepository::category_names() const
+UnpackagedRepository::category_names(const RepositoryContentMayExcludes &) const
{
return _imp->category_names;
}
std::shared_ptr<const CategoryNamePartSet>
-UnpackagedRepository::category_names_containing_package(const PackageNamePart & p) const
+UnpackagedRepository::category_names_containing_package(const PackageNamePart & p, const RepositoryContentMayExcludes &) const
{
return p == _imp->id->name().package() ? _imp->category_names : std::make_shared<CategoryNamePartSet>();
}
bool
-UnpackagedRepository::has_package_named(const QualifiedPackageName & q) const
+UnpackagedRepository::has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const
{
return q == _imp->id->name();
}
bool
-UnpackagedRepository::has_category_named(const CategoryNamePart & c) const
+UnpackagedRepository::has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return c == _imp->id->name().category();
}
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.hh b/paludis/repositories/unpackaged/unpackaged_repository.hh
index ad0efaa..e758c90 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.hh
+++ b/paludis/repositories/unpackaged/unpackaged_repository.hh
@@ -84,24 +84,24 @@ namespace paludis
virtual void invalidate_masks();
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 std::shared_ptr<const CategoryNamePartSet> category_names_containing_package(
- const PackageNamePart &) const
+ const PackageNamePart &, 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/unwritten/unwritten_repository.cc b/paludis/repositories/unwritten/unwritten_repository.cc
index 2e393ea..94cd46b 100644
--- a/paludis/repositories/unwritten/unwritten_repository.cc
+++ b/paludis/repositories/unwritten/unwritten_repository.cc
@@ -171,43 +171,43 @@ UnwrittenRepository::invalidate_masks()
}
bool
-UnwrittenRepository::has_category_named(const CategoryNamePart & c) const
+UnwrittenRepository::has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return _imp->store->has_category_named(c);
}
bool
-UnwrittenRepository::has_package_named(const QualifiedPackageName & q) const
+UnwrittenRepository::has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const
{
return _imp->store->has_package_named(q);
}
std::shared_ptr<const CategoryNamePartSet>
-UnwrittenRepository::category_names() const
+UnwrittenRepository::category_names(const RepositoryContentMayExcludes &) const
{
return _imp->store->category_names();
}
std::shared_ptr<const CategoryNamePartSet>
-UnwrittenRepository::unimportant_category_names() const
+UnwrittenRepository::unimportant_category_names(const RepositoryContentMayExcludes &) const
{
return _imp->store->unimportant_category_names();
}
std::shared_ptr<const CategoryNamePartSet>
-UnwrittenRepository::category_names_containing_package(const PackageNamePart & p) const
+UnwrittenRepository::category_names_containing_package(const PackageNamePart & p, const RepositoryContentMayExcludes & x) const
{
- return Repository::category_names_containing_package(p);
+ return Repository::category_names_containing_package(p, x);
}
std::shared_ptr<const QualifiedPackageNameSet>
-UnwrittenRepository::package_names(const CategoryNamePart & c) const
+UnwrittenRepository::package_names(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
return _imp->store->package_names(c);
}
std::shared_ptr<const PackageIDSequence>
-UnwrittenRepository::package_ids(const QualifiedPackageName & p) const
+UnwrittenRepository::package_ids(const QualifiedPackageName & p, const RepositoryContentMayExcludes &) const
{
return _imp->store->package_ids(p);
}
diff --git a/paludis/repositories/unwritten/unwritten_repository.hh b/paludis/repositories/unwritten/unwritten_repository.hh
index 46cd1d5..ecd914b 100644
--- a/paludis/repositories/unwritten/unwritten_repository.hh
+++ b/paludis/repositories/unwritten/unwritten_repository.hh
@@ -79,15 +79,15 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
- virtual bool has_category_named(const CategoryNamePart & c) const;
- virtual bool has_package_named(const QualifiedPackageName & q) const;
- virtual std::shared_ptr<const CategoryNamePartSet> category_names() const;
- virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names() const;
+ virtual bool has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const;
+ virtual bool has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const CategoryNamePartSet> category_names(const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names(const RepositoryContentMayExcludes &) const;
virtual std::shared_ptr<const CategoryNamePartSet> category_names_containing_package(
- const PackageNamePart & p) const;
+ const PackageNamePart & p, const RepositoryContentMayExcludes &) const;
virtual std::shared_ptr<const QualifiedPackageNameSet> package_names(
- const CategoryNamePart & c) const;
- virtual std::shared_ptr<const PackageIDSequence> package_ids(const QualifiedPackageName & p) const;
+ const CategoryNamePart & c, const RepositoryContentMayExcludes &) const;
+ virtual std::shared_ptr<const PackageIDSequence> package_ids(const QualifiedPackageName & p, const RepositoryContentMayExcludes &) const;
virtual bool some_ids_might_support_action(const SupportsActionTestBase &) const;
virtual bool some_ids_might_not_be_masked() const;
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 8d22042..06f223b 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 615e6f9..d946e21 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 8d9340f..c2270ae 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 048bc9e..e102960 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 48cbbe1..6c27e44 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()), " | "),
diff --git a/paludis/repository-fwd.hh b/paludis/repository-fwd.hh
index 4c60666..1be58a7 100644
--- a/paludis/repository-fwd.hh
+++ b/paludis/repository-fwd.hh
@@ -21,8 +21,10 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORY_FWD_HH 1
#include <paludis/util/set-fwd.hh>
+#include <paludis/util/options-fwd.hh>
#include <paludis/repository-fwd.hh>
#include <memory>
+#include <iosfwd>
/** \file
* Forward declarations for paludis/repository.hh .
@@ -47,6 +49,10 @@ namespace paludis
class RepositoryManifestInterface;
struct MergeParams;
+
+#include <paludis/repository-se.hh>
+
+ typedef Options<RepositoryContentMayExclude> RepositoryContentMayExcludes;
}
#endif
diff --git a/paludis/repository.cc b/paludis/repository.cc
index 1e9f29a..0805592 100644
--- a/paludis/repository.cc
+++ b/paludis/repository.cc
@@ -43,6 +43,8 @@
using namespace paludis;
+#include <paludis/repository-se.cc>
+
template class Set<std::shared_ptr<Repository> >;
template class WrappedForwardIterator<Set<std::shared_ptr<Repository> >::ConstIteratorTag, const std::shared_ptr<Repository> >;
template class WrappedOutputIterator<Set<std::shared_ptr<Repository> >::InserterTag, std::shared_ptr<Repository> >;
@@ -155,15 +157,15 @@ Repository::name() const
}
std::shared_ptr<const CategoryNamePartSet>
-Repository::category_names_containing_package(const PackageNamePart & p) const
+Repository::category_names_containing_package(const PackageNamePart & p, const RepositoryContentMayExcludes &) const
{
Context context("When finding category names containing package '" + stringify(p) + "':");
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
- std::shared_ptr<const CategoryNamePartSet> cats(category_names());
+ std::shared_ptr<const CategoryNamePartSet> cats(category_names({ }));
for (CategoryNamePartSet::ConstIterator c(cats->begin()), c_end(cats->end()) ;
c != c_end ; ++c)
- if (has_package_named(*c + p))
+ if (has_package_named(*c + p, { }))
result->insert(*c);
return result;
@@ -210,7 +212,7 @@ Repository::can_be_favourite_repository() const
}
std::shared_ptr<const CategoryNamePartSet>
-Repository::unimportant_category_names() const
+Repository::unimportant_category_names(const RepositoryContentMayExcludes &) const
{
return std::make_shared<CategoryNamePartSet>();
}
diff --git a/paludis/repository.hh b/paludis/repository.hh
index f99e1ca..eba8c1e 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -353,23 +353,29 @@ namespace paludis
/**
* Do we have a category with the given name?
+ *
+ * \since 0.59 takes repository_content_may_excludes
*/
- virtual bool has_category_named(const CategoryNamePart & c) const = 0;
+ virtual bool has_category_named(const CategoryNamePart & c,
+ const RepositoryContentMayExcludes & repository_content_may_excludes) const = 0;
/**
* Do we have a package in the given category with the given name?
*/
- virtual bool has_package_named(const QualifiedPackageName & q) const = 0;
+ virtual bool has_package_named(const QualifiedPackageName & q,
+ const RepositoryContentMayExcludes & repository_content_may_excludes) const = 0;
/**
* Fetch our category names.
*/
- virtual std::shared_ptr<const CategoryNamePartSet> category_names() const = 0;
+ virtual std::shared_ptr<const CategoryNamePartSet> category_names(
+ const RepositoryContentMayExcludes & repository_content_may_excludes) const = 0;
/**
* Fetch unimportant categories.
*/
- virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names() const;
+ virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names(
+ const RepositoryContentMayExcludes & repository_content_may_excludes) const;
/**
* Are we unimportant?
@@ -384,18 +390,21 @@ namespace paludis
* Fetch categories that contain a named package.
*/
virtual std::shared_ptr<const CategoryNamePartSet> category_names_containing_package(
- const PackageNamePart & p) const;
+ const PackageNamePart & p,
+ const RepositoryContentMayExcludes & repository_content_may_excludes) const;
/**
* Fetch our package names.
*/
virtual std::shared_ptr<const QualifiedPackageNameSet> package_names(
- const CategoryNamePart & c) const = 0;
+ const CategoryNamePart & c,
+ const RepositoryContentMayExcludes & repository_content_may_excludes) const = 0;
/**
* Fetch our IDs.
*/
- virtual std::shared_ptr<const PackageIDSequence> package_ids(const QualifiedPackageName & p) const = 0;
+ virtual std::shared_ptr<const PackageIDSequence> package_ids(const QualifiedPackageName & p,
+ const RepositoryContentMayExcludes & repository_content_may_excludes) const = 0;
/**
* Might some of our IDs support a particular action?
diff --git a/paludis/repository.se b/paludis/repository.se
new file mode 100644
index 0000000..22f96ca
--- /dev/null
+++ b/paludis/repository.se
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et ft=sh :
+
+make_enum_RepositoryContentMayExclude()
+{
+ prefix rcme
+
+ key rcme_masked "The result may exclude masked entries"
+
+ doxygen_comment << "END"
+ /**
+ * Allow Repository to produce a partial set of results to certain
+ * queries, if doing so would save time.
+ *
+ * \see Repository
+ * \ingroup g_repository
+ * \since 0.59
+ */
+END
+}
+
diff --git a/paludis/repository_name_cache.cc b/paludis/repository_name_cache.cc
index f106df0..26ae537 100644
--- a/paludis/repository_name_cache.cc
+++ b/paludis/repository_name_cache.cc
@@ -235,11 +235,11 @@ RepositoryNameCache::regenerate_cache() const
std::unordered_map<std::string, std::string, Hash<std::string> > m;
- std::shared_ptr<const CategoryNamePartSet> cats(_imp->repo->category_names());
+ std::shared_ptr<const CategoryNamePartSet> cats(_imp->repo->category_names({ }));
for (CategoryNamePartSet::ConstIterator c(cats->begin()), c_end(cats->end()) ;
c != c_end ; ++c)
{
- std::shared_ptr<const QualifiedPackageNameSet> pkgs(_imp->repo->package_names(*c));
+ std::shared_ptr<const QualifiedPackageNameSet> pkgs(_imp->repo->package_names(*c, { }));
for (QualifiedPackageNameSet::ConstIterator p(pkgs->begin()), p_end(pkgs->end()) ;
p != p_end ; ++p)
m[stringify(p->package())].append(stringify(*c) + "\n");
diff --git a/python/choices_TEST.py b/python/choices_TEST.py
index f785c31..b824d32 100644
--- a/python/choices_TEST.py
+++ b/python/choices_TEST.py
@@ -2,7 +2,7 @@
# vim: set fileencoding=utf-8 sw=4 sts=4 et :
#
-# Copyright (c) 2008 Ciaran McCreesh
+# Copyright (c) 2008, 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
@@ -32,7 +32,7 @@ Log.instance.log_level = LogLevel.WARNING
class TestCase_01_Choices(unittest.TestCase):
def setUp(self):
self.e = NoConfigEnvironment(repo_path, "/var/empty")
- self.pid = iter(self.e.package_database.fetch_repository("testrepo").package_ids("foo/bar")).next()
+ self.pid = iter(self.e.package_database.fetch_repository("testrepo").package_ids("foo/bar", [])).next()
self.choices = self.pid.find_metadata("PALUDIS_CHOICES").value()
def test_01_choices(self):
@@ -58,7 +58,7 @@ class TestCase_01_Choices(unittest.TestCase):
class TestCase_02_Choice(unittest.TestCase):
def setUp(self):
self.e = NoConfigEnvironment(repo_path, "/var/empty")
- self.pid = iter(self.e.package_database.fetch_repository("testrepo").package_ids("foo/bar")).next()
+ self.pid = iter(self.e.package_database.fetch_repository("testrepo").package_ids("foo/bar", [])).next()
self.choices = self.pid.find_metadata("PALUDIS_CHOICES").value()
self.use = None
self.linguas = None
@@ -107,7 +107,7 @@ class TestCase_02_Choice(unittest.TestCase):
class TestCase_03_ChoiceValue(unittest.TestCase):
def setUp(self):
self.e = NoConfigEnvironment(repo_path, "/var/empty")
- self.pid = iter(self.e.package_database.fetch_repository("testrepo").package_ids("foo/bar")).next()
+ self.pid = iter(self.e.package_database.fetch_repository("testrepo").package_ids("foo/bar", [])).next()
self.choices = self.pid.find_metadata("PALUDIS_CHOICES").value()
self.use_testflag = self.choices.find_by_name_with_prefix("testflag")
self.linguas_en = self.choices.find_by_name_with_prefix("linguas_en")
diff --git a/python/metadata_key_TEST.py b/python/metadata_key_TEST.py
index a13ed6b..9d6a74a 100755
--- a/python/metadata_key_TEST.py
+++ b/python/metadata_key_TEST.py
@@ -34,8 +34,8 @@ class TestCase_01_MetadataKeys(unittest.TestCase):
def setUp(self):
self.e = NoConfigEnvironment(repo_path, "/var/empty")
self.ie = NoConfigEnvironment(irepo_path)
- self.pid = iter(self.e.package_database.fetch_repository("testrepo").package_ids("foo/bar")).next()
- self.ipid = iter(self.ie.package_database.fetch_repository("installed").package_ids("cat-one/pkg-one")).next()
+ self.pid = iter(self.e.package_database.fetch_repository("testrepo").package_ids("foo/bar", [])).next()
+ self.ipid = iter(self.ie.package_database.fetch_repository("installed").package_ids("cat-one/pkg-one", [])).next()
def test_01_contents(self):
self.assertEquals(self.pid.find_metadata("CONTENTS"), None)
@@ -73,7 +73,7 @@ class TestCase_02_MetadataKeys_suclassing(unittest.TestCase):
def value(self):
e = NoConfigEnvironment(repo_path, "/var/empty")
- pid = iter(e.package_database.fetch_repository("testrepo").package_ids("foo/bar")).next()
+ pid = iter(e.package_database.fetch_repository("testrepo").package_ids("foo/bar", [])).next()
return pid
def raw_name(self):
diff --git a/python/package_id_TEST.py b/python/package_id_TEST.py
index 24d43d8..123387e 100755
--- a/python/package_id_TEST.py
+++ b/python/package_id_TEST.py
@@ -32,11 +32,11 @@ class TestCase_01_PackageID(unittest.TestCase):
def setUp(self):
self.e = NoConfigEnvironment(repo_path, "/var/empty")
self.ie = NoConfigEnvironment(irepo_path)
- self.pid = iter(self.e.package_database.fetch_repository("testrepo").package_ids("foo/bar")).next()
+ self.pid = iter(self.e.package_database.fetch_repository("testrepo").package_ids("foo/bar", [])).next()
if os.environ.get("PALUDIS_ENABLE_VIRTUALS_REPOSITORY") == "yes":
- self.vpid = iter(self.e.package_database.fetch_repository("virtuals").package_ids("virtual/bar")).next()
- self.ipid = iter(self.ie.package_database.fetch_repository("installed").package_ids("cat-one/pkg-one")).next()
- self.mpid = iter(self.e.package_database.fetch_repository("testrepo").package_ids("cat/masked")).next()
+ self.vpid = iter(self.e.package_database.fetch_repository("virtuals").package_ids("virtual/bar", [])).next()
+ self.ipid = iter(self.ie.package_database.fetch_repository("installed").package_ids("cat-one/pkg-one", [])).next()
+ self.mpid = iter(self.e.package_database.fetch_repository("testrepo").package_ids("cat/masked", [])).next()
def test_01_get(self):
pass
diff --git a/python/repository.cc b/python/repository.cc
index bbcce38..6cc4756 100644
--- a/python/repository.cc
+++ b/python/repository.cc
@@ -18,6 +18,8 @@
*/
#include <python/paludis_python.hh>
+#include <python/exception.hh>
+#include <python/options.hh>
#include <python/iterable.hh>
#include <paludis/repository.hh>
@@ -132,32 +134,32 @@ void expose_repository()
)
.def("has_category_named", &Repository::has_category_named,
- "has_category_named(CategoryNamePart) -> bool\n"
+ "has_category_named(CategoryNamePart, RepositoryContentMayExcludes) -> bool\n"
"Do we have a category with the given name?"
)
.def("has_package_named", &Repository::has_package_named,
- "has_package_named(QualifiedPackageName) -> bool\n"
+ "has_package_named(QualifiedPackageName, RepositoryContentMayExcludes) -> bool\n"
"Do we have a package in the given category with the given name?"
)
- .add_property("category_names", &Repository::category_names,
- "[ro] CategoryNamePartIterable\n"
+ .def("category_names", &Repository::category_names,
+ "category_names(RepositoryContentMayExcludes) -> CategoryNamePartIterable\n"
"Our category names."
)
.def("category_names_containing_package", &Repository::category_names_containing_package,
- "category_names_containing_package(PackageNamePart) -> CategoryNamePartIterable\n"
+ "category_names_containing_package(PackageNamePart, RepositoryContentMayExcludes) -> CategoryNamePartIterable\n"
"Fetch categories that contain a named package."
)
.def("package_names", &Repository::package_names,
- "package_names(CategoryNamePart) -> QualifiedPackageNameIterable\n"
+ "package_names(CategoryNamePart, RepositoryContentMayExcludes) -> QualifiedPackageNameIterable\n"
"Fetch our package names."
)
.def("package_ids", &Repository::package_ids, bp::with_custodian_and_ward_postcall<0, 1>(),
- "package_ids(QualifiedPackageName) -> PackageIDIterable\n"
+ "package_ids(QualifiedPackageName, RepositoryContentMayExcludes) -> PackageIDIterable\n"
"Fetch our versions."
)
@@ -279,4 +281,11 @@ void expose_repository()
.def("add_version", &FakeRepositoryWrapper::add_version)
;
+
+ enum_auto("RepositoryContentMayExclude", last_rcme,
+ "Tells repository it may exclude certain content from queries if doing so will be faster.");
+
+ class_options<RepositoryContentMayExcludes>("RepositoryContentMayExcludes", "RepositoryContentMayExclude",
+ "Options for various Repository methods.");
}
+
diff --git a/python/repository_TEST.py b/python/repository_TEST.py
index 16eaa48..711efbe 100755
--- a/python/repository_TEST.py
+++ b/python/repository_TEST.py
@@ -53,30 +53,30 @@ class TestCase_01_Repository(unittest.TestCase):
self.assertEquals(str(irepo.name), "installed")
def test_05_has_category_named(self):
- self.assert_(repo.has_category_named("foo"))
- self.assert_(not repo.has_category_named("bar"))
+ self.assert_(repo.has_category_named("foo", []))
+ self.assert_(not repo.has_category_named("bar", []))
def test_06_has_package_named(self):
- self.assert_(repo.has_package_named("foo/bar"))
- self.assert_(not repo.has_package_named("foo/foo"))
- self.assert_(not repo.has_package_named("bar/foo"))
+ self.assert_(repo.has_package_named("foo/bar", []))
+ self.assert_(not repo.has_package_named("foo/foo", []))
+ self.assert_(not repo.has_package_named("bar/foo", []))
def test_07_package_ids(self):
- y = list(x.version for x in repo.package_ids("foo/bar"));
+ y = list(x.version for x in repo.package_ids("foo/bar", []));
y.sort()
z = [VersionSpec("1.0"), VersionSpec("2.0")]
self.assertEquals(y, z)
- self.assertEquals(len(list(repo.package_ids("bar/baz"))), 0)
+ self.assertEquals(len(list(repo.package_ids("bar/baz", []))), 0)
def test_08_category_names(self):
- self.assertEquals([str(x) for x in repo.category_names], ["foo", "foo1", "foo2", "foo3", "foo4"])
+ self.assertEquals([str(x) for x in repo.category_names([])], ["foo", "foo1", "foo2", "foo3", "foo4"])
def test_09_category_names_containing_package(self):
- self.assertEquals([str(x) for x in repo.category_names_containing_package("bar")],
+ self.assertEquals([str(x) for x in repo.category_names_containing_package("bar", [])],
["foo", "foo1", "foo2", "foo3", "foo4"])
def test_10_package_names(self):
- for (i, qpn) in enumerate(repo.package_names("bar")):
+ for (i, qpn) in enumerate(repo.package_names("bar", [])):
self.assertEquals(i, 0)
self.assertEquals(str(qpn), "foo/bar")
@@ -161,14 +161,14 @@ class TestCase_03_FakeRepository(unittest.TestCase):
self.assertRaises(Exception, FakeRepository, "foo", "foo")
def test_03_add_category(self):
- self.assertEquals(list(f.category_names), [])
+ self.assertEquals(list(f.category_names([])), [])
f.add_category("cat-foo")
- self.assertEquals([str(x) for x in f.category_names], ["cat-foo"])
+ self.assertEquals([str(x) for x in f.category_names([])], ["cat-foo"])
f.add_category("cat-foo")
- self.assertEquals([str(x) for x in f.category_names], ["cat-foo"])
+ self.assertEquals([str(x) for x in f.category_names([])], ["cat-foo"])
f.add_category("cat-bar")
- self.assertEquals([str(x) for x in f.category_names], ["cat-bar", "cat-foo"])
+ self.assertEquals([str(x) for x in f.category_names([])], ["cat-bar", "cat-foo"])
def test_04_add_category_bad(self):
self.assertRaises(Exception, f.add_category, 1)
@@ -180,18 +180,18 @@ class TestCase_03_FakeRepository(unittest.TestCase):
bar_1 = QualifiedPackageName("cat-bar/pkg1")
f.add_category("cat-foo")
- self.assertEquals(list(f.package_names("cat-foo")), [])
+ self.assertEquals(list(f.package_names("cat-foo", [])), [])
f.add_package(foo_1)
- self.assertEquals(list(f.package_names("cat-foo")), [foo_1])
+ self.assertEquals(list(f.package_names("cat-foo", [])), [foo_1])
f.add_package(foo_1)
- self.assertEquals(list(f.package_names("cat-foo")), [foo_1])
+ self.assertEquals(list(f.package_names("cat-foo", [])), [foo_1])
f.add_package(foo_2)
- self.assertEquals(list(f.package_names("cat-foo")), [foo_1, foo_2])
+ self.assertEquals(list(f.package_names("cat-foo", [])), [foo_1, foo_2])
f.add_package(bar_1)
- self.assertEquals(list(f.package_names("cat-bar")), [bar_1])
+ self.assertEquals(list(f.package_names("cat-bar", [])), [bar_1])
def test_06_add_package_bad(self):
self.assertRaises(Exception, f.add_category, 1)
@@ -199,20 +199,20 @@ class TestCase_03_FakeRepository(unittest.TestCase):
def test_07_add_version(self):
f.add_package("cat-foo/pkg")
- self.assertEquals(list(f.package_ids("cat-foo/pkg")), [])
+ self.assertEquals(list(f.package_ids("cat-foo/pkg", [])), [])
pkg = f.add_version("cat-foo/pkg", VersionSpec("1"))
- self.assertEquals(list(f.package_ids("cat-foo/pkg")), [pkg])
+ self.assertEquals(list(f.package_ids("cat-foo/pkg", [])), [pkg])
self.assertEquals(pkg.version, VersionSpec("1"))
pkg2 = f.add_version("cat-foo/pkg", VersionSpec("2"))
- self.assertEquals(list(f.package_ids("cat-foo/pkg")), [pkg, pkg2])
+ self.assertEquals(list(f.package_ids("cat-foo/pkg", [])), [pkg, pkg2])
self.assertEquals(pkg2.version, VersionSpec("2"))
pkg3 = f.add_version("cat-bar/pkg", VersionSpec("0"))
- self.assertEquals(list(f.package_ids("cat-bar/pkg")), [pkg3])
+ self.assertEquals(list(f.package_ids("cat-bar/pkg", [])), [pkg3])
- self.assertEquals([str(x) for x in f.category_names], ["cat-bar", "cat-foo"])
+ self.assertEquals([str(x) for x in f.category_names([])], ["cat-bar", "cat-foo"])
def test_08_add_version_bad(self):
self.assertRaises(Exception, f.add_version, 1)
diff --git a/ruby/repository.cc b/ruby/repository.cc
index 944d038..15803aa 100644
--- a/ruby/repository.cc
+++ b/ruby/repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
* Copyright (c) 2006, 2007, 2008 Richard Brown
* Copyright (c) 2007 David Leverton
*
@@ -96,7 +96,7 @@ namespace
{
std::shared_ptr<Repository> * self_ptr;
Data_Get_Struct(self, std::shared_ptr<Repository>, self_ptr);
- return (*self_ptr)->has_category_named(CategoryNamePart(StringValuePtr(cat))) ? Qtrue : Qfalse;
+ return (*self_ptr)->has_category_named(CategoryNamePart(StringValuePtr(cat)), { }) ? Qtrue : Qfalse;
}
catch (const std::exception & e)
{
@@ -121,7 +121,7 @@ namespace
{
std::shared_ptr<Repository> * self_ptr;
Data_Get_Struct(self, std::shared_ptr<Repository>, self_ptr);
- return (*self_ptr)->has_package_named(value_to_qualified_package_name(name)) ? Qtrue : Qfalse;
+ return (*self_ptr)->has_package_named(value_to_qualified_package_name(name), { }) ? Qtrue : Qfalse;
}
catch (const std::exception & e)
{
@@ -145,13 +145,13 @@ namespace
Data_Get_Struct(self, std::shared_ptr<Repository>, self_ptr);
if (rb_block_given_p())
{
- std::shared_ptr<const CategoryNamePartSet> c((*self_ptr)->category_names());
+ std::shared_ptr<const CategoryNamePartSet> c((*self_ptr)->category_names({ }));
for (CategoryNamePartSet::ConstIterator i(c->begin()), i_end(c->end()) ; i != i_end ; ++i)
rb_yield(rb_str_new2(stringify(*i).c_str()));
return Qnil;
}
VALUE result(rb_ary_new());
- std::shared_ptr<const CategoryNamePartSet> c((*self_ptr)->category_names());
+ std::shared_ptr<const CategoryNamePartSet> c((*self_ptr)->category_names({ }));
for (CategoryNamePartSet::ConstIterator i(c->begin()), i_end(c->end()) ; i != i_end ; ++i)
rb_ary_push(result, rb_str_new2(stringify(*i).c_str()));
return result;
@@ -181,13 +181,13 @@ namespace
if (rb_block_given_p())
{
- std::shared_ptr<const CategoryNamePartSet> c((*self_ptr)->category_names_containing_package(package));
+ std::shared_ptr<const CategoryNamePartSet> c((*self_ptr)->category_names_containing_package(package, { }));
for (CategoryNamePartSet::ConstIterator i(c->begin()), i_end(c->end()) ; i != i_end ; ++i)
rb_yield(rb_str_new2(stringify(*i).c_str()));
return Qnil;
}
VALUE result(rb_ary_new());
- std::shared_ptr<const CategoryNamePartSet> c((*self_ptr)->category_names_containing_package(package));
+ std::shared_ptr<const CategoryNamePartSet> c((*self_ptr)->category_names_containing_package(package, { }));
for (CategoryNamePartSet::ConstIterator i(c->begin()), i_end(c->end()) ; i != i_end ; ++i)
rb_ary_push(result, rb_str_new2(stringify(*i).c_str()));
return result;
@@ -217,13 +217,13 @@ namespace
if (rb_block_given_p())
{
- std::shared_ptr<const QualifiedPackageNameSet> c((*self_ptr)->package_names(category));
+ std::shared_ptr<const QualifiedPackageNameSet> c((*self_ptr)->package_names(category, { }));
for (QualifiedPackageNameSet::ConstIterator i(c->begin()), i_end(c->end()) ; i != i_end ; ++i)
rb_yield(qualified_package_name_to_value(*i));
return Qnil;
}
VALUE result(rb_ary_new());
- std::shared_ptr<const QualifiedPackageNameSet> c((*self_ptr)->package_names(category));
+ std::shared_ptr<const QualifiedPackageNameSet> c((*self_ptr)->package_names(category, { }));
for (QualifiedPackageNameSet::ConstIterator i(c->begin()), i_end(c->end()) ; i != i_end ; ++i)
rb_ary_push(result, qualified_package_name_to_value(*i));
return result;
@@ -254,13 +254,13 @@ namespace
if (rb_block_given_p())
{
- std::shared_ptr<const PackageIDSequence> c((*self_ptr)->package_ids(q));
+ std::shared_ptr<const PackageIDSequence> c((*self_ptr)->package_ids(q, { }));
for (PackageIDSequence::ConstIterator i(c->begin()), i_end(c->end()) ; i != i_end ; ++i)
rb_yield(package_id_to_value(*i));
return Qnil;
}
VALUE result(rb_ary_new());
- std::shared_ptr<const PackageIDSequence> c((*self_ptr)->package_ids(q));
+ std::shared_ptr<const PackageIDSequence> c((*self_ptr)->package_ids(q, { }));
for (PackageIDSequence::ConstIterator i(c->begin()), i_end(c->end()) ; i != i_end ; ++i)
rb_ary_push(result, package_id_to_value(*i));
return result;
diff --git a/src/clients/appareo/appareo.cc b/src/clients/appareo/appareo.cc
index e18bd1b..3a19f97 100644
--- a/src/clients/appareo/appareo.cc
+++ b/src/clients/appareo/appareo.cc
@@ -259,7 +259,7 @@ main(int argc, char *argv[])
unsigned success(0), total(0);
- std::shared_ptr<const CategoryNamePartSet> cat_names(env.main_repository()->category_names());
+ std::shared_ptr<const CategoryNamePartSet> cat_names(env.main_repository()->category_names({ }));
for (CategoryNamePartSet::ConstIterator c(cat_names->begin()), c_end(cat_names->end()) ;
c != c_end ; ++c)
{
@@ -270,7 +270,7 @@ main(int argc, char *argv[])
stringify(*c)))
continue;
- std::shared_ptr<const QualifiedPackageNameSet> pkg_names(env.main_repository()->package_names(*c));
+ std::shared_ptr<const QualifiedPackageNameSet> pkg_names(env.main_repository()->package_names(*c, { }));
for (QualifiedPackageNameSet::ConstIterator p(pkg_names->begin()), p_end(pkg_names->end()) ;
p != p_end ; ++p)
{
diff --git a/src/clients/cave/cmd_find_candidates.cc b/src/clients/cave/cmd_find_candidates.cc
index 1cd4a17..e48668a 100644
--- a/src/clients/cave/cmd_find_candidates.cc
+++ b/src/clients/cave/cmd_find_candidates.cc
@@ -223,7 +223,7 @@ FindCandidatesCommand::run_hosted(
r != r_end ; ++r)
{
const std::shared_ptr<const Repository> repo(env->package_database()->fetch_repository(*r));
- const std::shared_ptr<const CategoryNamePartSet> cats(repo->category_names());
+ const std::shared_ptr<const CategoryNamePartSet> cats(repo->category_names({ }));
std::copy(cats->begin(), cats->end(), std::inserter(category_names, category_names.end()));
}
@@ -237,7 +237,7 @@ FindCandidatesCommand::run_hosted(
for (CategoryNames::const_iterator c(category_names.begin()), c_end(category_names.end()) ;
c != c_end ; ++c)
{
- const std::shared_ptr<const QualifiedPackageNameSet> qpns(repo->package_names(*c));
+ const std::shared_ptr<const QualifiedPackageNameSet> qpns(repo->package_names(*c, { }));
std::copy(qpns->begin(), qpns->end(), std::inserter(package_names, package_names.end()));
}
}
diff --git a/src/clients/cave/cmd_import.cc b/src/clients/cave/cmd_import.cc
index de1a441..a34a23d 100644
--- a/src/clients/cave/cmd_import.cc
+++ b/src/clients/cave/cmd_import.cc
@@ -292,7 +292,7 @@ ImportCommand::run(
std::shared_ptr<Repository> repo(RepositoryFactory::get_instance()->create(env.get(),
std::bind(from_keys, keys, std::placeholders::_1)));
env->package_database()->add_repository(10, repo);
- std::shared_ptr<const PackageIDSequence> ids(repo->package_ids(package));
+ std::shared_ptr<const PackageIDSequence> ids(repo->package_ids(package, { }));
if (1 != std::distance(ids->begin(), ids->end()))
throw InternalError(PALUDIS_HERE, "ids is '" + join(indirect_iterator(ids->begin()), indirect_iterator(
ids->end()), " ") + "'");
diff --git a/src/clients/cave/cmd_print_categories.cc b/src/clients/cave/cmd_print_categories.cc
index e8d24ad..e583399 100644
--- a/src/clients/cave/cmd_print_categories.cc
+++ b/src/clients/cave/cmd_print_categories.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 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
@@ -109,13 +109,13 @@ PrintCategoriesCommand::run(
for (args::StringSetArg::ConstIterator p(cmdline.a_containing.begin_args()), p_end(cmdline.a_containing.end_args()) ;
p != p_end ; ++p)
{
- std::shared_ptr<const CategoryNamePartSet> cats((*r)->category_names_containing_package(PackageNamePart(*p)));
+ std::shared_ptr<const CategoryNamePartSet> cats((*r)->category_names_containing_package(PackageNamePart(*p), { }));
std::copy(cats->begin(), cats->end(), std::inserter(categories, categories.begin()));
}
}
else
{
- std::shared_ptr<const CategoryNamePartSet> cats((*r)->category_names());
+ std::shared_ptr<const CategoryNamePartSet> cats((*r)->category_names({ }));
std::copy(cats->begin(), cats->end(), std::inserter(categories, categories.begin()));
}
}
diff --git a/src/clients/cave/cmd_print_packages.cc b/src/clients/cave/cmd_print_packages.cc
index 499abc4..0fb64d4 100644
--- a/src/clients/cave/cmd_print_packages.cc
+++ b/src/clients/cave/cmd_print_packages.cc
@@ -102,7 +102,7 @@ PrintPackagesCommand::run(
cmdline.a_repository.begin_args(), cmdline.a_repository.end_args(), stringify((*r)->name())))
continue;
- std::shared_ptr<const CategoryNamePartSet> categories((*r)->category_names());
+ std::shared_ptr<const CategoryNamePartSet> categories((*r)->category_names({ }));
for (CategoryNamePartSet::ConstIterator c(categories->begin()), c_end(categories->end());
c != c_end; ++c)
{
@@ -111,7 +111,7 @@ PrintPackagesCommand::run(
cmdline.a_category.begin_args(), cmdline.a_category.end_args(), stringify(*c)))
continue;
- std::shared_ptr<const QualifiedPackageNameSet> packages((*r)->package_names(*c));
+ std::shared_ptr<const QualifiedPackageNameSet> packages((*r)->package_names(*c, { }));
std::copy(packages->begin(), packages->end(), std::inserter(all_packages, all_packages.begin()));
}
}