aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-28 19:38:42 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-28 20:13:47 +0000
commit22f59a9b5e9493a6168653d6428435287e8b94c9 (patch)
tree1333aa51cb187d820d6765cb441dc2fd6d5ff3d7
parentee54b61ac9076804b16e345a8337799ebd2654a5 (diff)
downloadpaludis-22f59a9b5e9493a6168653d6428435287e8b94c9.tar.gz
paludis-22f59a9b5e9493a6168653d6428435287e8b94c9.tar.xz
Make use of rcme_not_installed
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc21
1 files changed, 18 insertions, 3 deletions
diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc
index f93a8d6..bfcca8c 100644
--- a/paludis/repositories/unavailable/unavailable_repository.cc
+++ b/paludis/repositories/unavailable/unavailable_repository.cc
@@ -64,7 +64,7 @@ namespace paludis
std::shared_ptr<UnavailableRepositoryStore> > > store;
const std::shared_ptr<CategoryNamePartSet> unmasked_category_names;
- const std::shared_ptr<PackageIDSequence> unmasked_non_repository_package_ids;
+ const std::shared_ptr<PackageIDSequence> no_package_ids;
Imp(const UnavailableRepository * const repo, const UnavailableRepositoryParams & p) :
params(p),
@@ -81,7 +81,7 @@ namespace paludis
store(DeferredConstructionPtr<std::shared_ptr<UnavailableRepositoryStore> > (
std::bind(&make_store, repo, std::cref(params)))),
unmasked_category_names(std::make_shared<CategoryNamePartSet>()),
- unmasked_non_repository_package_ids(std::make_shared<PackageIDSequence>())
+ no_package_ids(std::make_shared<PackageIDSequence>())
{
for (auto i(params.sync()->begin()), i_end(params.sync()->end()) ;
i != i_end ; ++i)
@@ -181,6 +181,9 @@ UnavailableRepository::has_category_named(const CategoryNamePart & c, const Repo
{
Context context("When checking for category named '" + stringify(c) + "' in '" + stringify(name()) + ":");
+ if (x[rcme_not_installed])
+ return false;
+
if (x[rcme_masked])
{
/* we're only interested in unmasked packages, which are in repository/ */
@@ -195,6 +198,9 @@ UnavailableRepository::has_package_named(const QualifiedPackageName & q, const R
{
Context context("When checking for package named '" + stringify(q) + "' in '" + stringify(name()) + ":");
+ if (x[rcme_not_installed])
+ return false;
+
if (x[rcme_masked])
{
/* we're only interested in unmasked packages, which are in repository/ */
@@ -210,6 +216,12 @@ UnavailableRepository::category_names(const RepositoryContentMayExcludes & x) co
{
Context context("When checking for categories in '" + stringify(name()) + ":");
+ if (x[rcme_not_installed])
+ {
+ /* nothing, but we're allowed to return extras */
+ return _imp->unmasked_category_names;
+ }
+
if (x[rcme_masked])
return _imp->unmasked_category_names;
@@ -243,8 +255,11 @@ UnavailableRepository::package_ids(const QualifiedPackageName & p, const Reposit
{
Context context("When checking for package IDs in '" + stringify(p) + "' in '" + stringify(name()) + ":");
+ if (x[rcme_not_installed])
+ return _imp->no_package_ids;
+
if (x[rcme_masked] && p.category() != CategoryNamePart("repository"))
- return _imp->unmasked_non_repository_package_ids;
+ return _imp->no_package_ids;
return _imp->store->package_ids(p);
}