aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-28 15:29:40 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-28 16:50:38 +0000
commit6af1661baa97ae5f10da9cbc3b9899eb2be16f87 (patch)
tree1aac2323f0ad83807069c55344d61ab9b7d4f833
parent0d16be4747a5f23e68ac77765275b6ab345000af (diff)
downloadpaludis-6af1661baa97ae5f10da9cbc3b9899eb2be16f87.tar.gz
paludis-6af1661baa97ae5f10da9cbc3b9899eb2be16f87.tar.xz
Let generators use excludes
-rw-r--r--paludis/generator.cc146
-rw-r--r--paludis/generator.hh13
-rw-r--r--paludis/generator_handler.cc18
-rw-r--r--paludis/generator_handler.hh27
-rw-r--r--paludis/resolver/destination_utils.cc5
-rw-r--r--paludis/selection.cc56
6 files changed, 155 insertions, 110 deletions
diff --git a/paludis/generator.cc b/paludis/generator.cc
index 5378ae8..ffa0d5a 100644
--- a/paludis/generator.cc
+++ b/paludis/generator.cc
@@ -83,35 +83,39 @@ Generator::operator FilteredGenerator () const
std::shared_ptr<const RepositoryNameSet>
Generator::repositories(
- const Environment * const env) const
+ const Environment * const env,
+ const RepositoryContentMayExcludes & x) const
{
- return _imp->handler->repositories(env);
+ return _imp->handler->repositories(env, x);
}
std::shared_ptr<const CategoryNamePartSet>
Generator::categories(
const Environment * const env,
- const std::shared_ptr<const RepositoryNameSet> & r) const
+ const std::shared_ptr<const RepositoryNameSet> & r,
+ const RepositoryContentMayExcludes & x) const
{
- return _imp->handler->categories(env, r);
+ return _imp->handler->categories(env, r, x);
}
std::shared_ptr<const QualifiedPackageNameSet>
Generator::packages(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & r,
- const std::shared_ptr<const CategoryNamePartSet> & c) const
+ const std::shared_ptr<const CategoryNamePartSet> & c,
+ const RepositoryContentMayExcludes & x) const
{
- return _imp->handler->packages(env, r, c);
+ return _imp->handler->packages(env, r, c, x);
}
std::shared_ptr<const PackageIDSet>
Generator::ids(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & r,
- const std::shared_ptr<const QualifiedPackageNameSet> & q) const
+ const std::shared_ptr<const QualifiedPackageNameSet> & q,
+ const RepositoryContentMayExcludes & x) const
{
- return _imp->handler->ids(env, r, q);
+ return _imp->handler->ids(env, r, q, x);
}
std::string
@@ -133,7 +137,8 @@ namespace
}
virtual std::shared_ptr<const RepositoryNameSet> repositories(
- const Environment * const env) const
+ const Environment * const env,
+ const RepositoryContentMayExcludes &) const
{
using namespace std::placeholders;
std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
@@ -161,7 +166,8 @@ namespace
virtual std::shared_ptr<const PackageIDSet> ids(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos,
- const std::shared_ptr<const QualifiedPackageNameSet> & qpns) const
+ const std::shared_ptr<const QualifiedPackageNameSet> & qpns,
+ const RepositoryContentMayExcludes & x) const
{
std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
@@ -172,7 +178,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, x));
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() !=
@@ -202,14 +208,15 @@ namespace
virtual std::shared_ptr<const CategoryNamePartSet> categories(
const Environment * const env,
- const std::shared_ptr<const RepositoryNameSet> & repos
+ const std::shared_ptr<const RepositoryNameSet> & repos,
+ const RepositoryContentMayExcludes & x
) const
{
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(name, { }))
+ if (env->package_database()->fetch_repository(*r)->has_category_named(name, x))
{
result->insert(name);
break;
@@ -236,14 +243,15 @@ namespace
virtual std::shared_ptr<const CategoryNamePartSet> categories(
const Environment * const env,
- const std::shared_ptr<const RepositoryNameSet> & repos
+ const std::shared_ptr<const RepositoryNameSet> & repos,
+ const RepositoryContentMayExcludes & x
) const
{
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(name.category(), { }))
+ if (env->package_database()->fetch_repository(*r)->has_category_named(name.category(), x))
{
result->insert(name.category());
break;
@@ -255,14 +263,15 @@ namespace
virtual std::shared_ptr<const QualifiedPackageNameSet> packages(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos,
- const std::shared_ptr<const CategoryNamePartSet> & cats) const
+ const std::shared_ptr<const CategoryNamePartSet> & cats,
+ const RepositoryContentMayExcludes & x) const
{
std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
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, x))
result->insert(name);
return result;
@@ -289,7 +298,8 @@ namespace
}
virtual std::shared_ptr<const RepositoryNameSet> repositories(
- const Environment * const env) const
+ const Environment * const env,
+ const RepositoryContentMayExcludes & x) const
{
if (package_dep_spec_has_properties(spec, make_named_values<PackageDepSpecProperties>(
n::has_additional_requirements() = indeterminate,
@@ -305,7 +315,7 @@ namespace
n::has_tag() = indeterminate,
n::has_version_requirements() = indeterminate
)))
- return AllGeneratorHandlerBase::repositories(env);
+ return AllGeneratorHandlerBase::repositories(env, x);
std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
@@ -343,7 +353,7 @@ namespace
}
}
else
- return AllGeneratorHandlerBase::repositories(env);
+ return AllGeneratorHandlerBase::repositories(env, x);
}
return result;
@@ -351,14 +361,15 @@ namespace
virtual std::shared_ptr<const CategoryNamePartSet> categories(
const Environment * const env,
- const std::shared_ptr<const RepositoryNameSet> & repos) const
+ const std::shared_ptr<const RepositoryNameSet> & repos,
+ const RepositoryContentMayExcludes & x) const
{
if (spec.category_name_part_ptr())
{
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(), x))
{
result->insert(*spec.category_name_part_ptr());
break;
@@ -374,7 +385,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(), x));
std::copy(cats->begin(), cats->end(), result->inserter());
}
@@ -385,7 +396,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(), x))
{
result->insert(spec.package_ptr()->category());
break;
@@ -394,13 +405,14 @@ namespace
return result;
}
else
- return AllGeneratorHandlerBase::categories(env, repos);
+ return AllGeneratorHandlerBase::categories(env, repos, x);
}
virtual std::shared_ptr<const QualifiedPackageNameSet> packages(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos,
- const std::shared_ptr<const CategoryNamePartSet> & cats) const
+ const std::shared_ptr<const CategoryNamePartSet> & cats,
+ const RepositoryContentMayExcludes & x) const
{
if (spec.package_name_part_ptr())
{
@@ -409,7 +421,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(), x))
result->insert(*c + *spec.package_name_part_ptr());
return result;
@@ -419,7 +431,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(), x))
{
result->insert(*spec.package_ptr());
break;
@@ -428,13 +440,14 @@ namespace
return result;
}
else
- return AllGeneratorHandlerBase::packages(env, repos, cats);
+ return AllGeneratorHandlerBase::packages(env, repos, cats, x);
}
virtual std::shared_ptr<const PackageIDSet> ids(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos,
- const std::shared_ptr<const QualifiedPackageNameSet> & qpns) const
+ const std::shared_ptr<const QualifiedPackageNameSet> & qpns,
+ const RepositoryContentMayExcludes & x) const
{
std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
@@ -445,7 +458,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, x));
for (PackageIDSequence::ConstIterator i(id->begin()), i_end(id->end()) ;
i != i_end ; ++i)
if (match_package(*env, spec, *i, from_id, options))
@@ -478,13 +491,14 @@ namespace
}
virtual std::shared_ptr<const RepositoryNameSet> repositories(
- const Environment * const env) const
+ const Environment * const env,
+ const RepositoryContentMayExcludes & x) const
{
- std::shared_ptr<const RepositoryNameSet> r1(g1.repositories(env));
+ std::shared_ptr<const RepositoryNameSet> r1(g1.repositories(env, x));
if (r1->empty())
return r1;
- std::shared_ptr<const RepositoryNameSet> r2(g2.repositories(env));
+ std::shared_ptr<const RepositoryNameSet> r2(g2.repositories(env, x));
if (r2->empty())
return r2;
@@ -498,13 +512,14 @@ namespace
virtual std::shared_ptr<const CategoryNamePartSet> categories(
const Environment * const env,
- const std::shared_ptr<const RepositoryNameSet> & repos) const
+ const std::shared_ptr<const RepositoryNameSet> & repos,
+ const RepositoryContentMayExcludes & x) const
{
- std::shared_ptr<const CategoryNamePartSet> c1(g1.categories(env, repos));
+ std::shared_ptr<const CategoryNamePartSet> c1(g1.categories(env, repos, x));
if (c1->empty())
return c1;
- std::shared_ptr<const CategoryNamePartSet> c2(g2.categories(env, repos));
+ std::shared_ptr<const CategoryNamePartSet> c2(g2.categories(env, repos, x));
if (c2->empty())
return c2;
@@ -519,13 +534,14 @@ namespace
virtual std::shared_ptr<const QualifiedPackageNameSet> packages(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos,
- const std::shared_ptr<const CategoryNamePartSet> & cats) const
+ const std::shared_ptr<const CategoryNamePartSet> & cats,
+ const RepositoryContentMayExcludes & x) const
{
- std::shared_ptr<const QualifiedPackageNameSet> q1(g1.packages(env, repos, cats));
+ std::shared_ptr<const QualifiedPackageNameSet> q1(g1.packages(env, repos, cats, x));
if (q1->empty())
return q1;
- std::shared_ptr<const QualifiedPackageNameSet> q2(g2.packages(env, repos, cats));
+ std::shared_ptr<const QualifiedPackageNameSet> q2(g2.packages(env, repos, cats, x));
if (q2->empty())
return q2;
@@ -540,13 +556,14 @@ namespace
virtual std::shared_ptr<const PackageIDSet> ids(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos,
- const std::shared_ptr<const QualifiedPackageNameSet> & qpns) const
+ const std::shared_ptr<const QualifiedPackageNameSet> & qpns,
+ const RepositoryContentMayExcludes & x) const
{
- std::shared_ptr<const PackageIDSet> i1(g1.ids(env, repos, qpns));
+ std::shared_ptr<const PackageIDSet> i1(g1.ids(env, repos, qpns, x));
if (i1->empty())
return i1;
- std::shared_ptr<const PackageIDSet> i2(g2.ids(env, repos, qpns));
+ std::shared_ptr<const PackageIDSet> i2(g2.ids(env, repos, qpns, x));
if (i2->empty())
return i2;
@@ -578,10 +595,11 @@ namespace
}
virtual std::shared_ptr<const RepositoryNameSet> repositories(
- const Environment * const env) const
+ const Environment * const env,
+ const RepositoryContentMayExcludes & x) const
{
- std::shared_ptr<const RepositoryNameSet> r1(g1.repositories(env));
- std::shared_ptr<const RepositoryNameSet> r2(g2.repositories(env));
+ std::shared_ptr<const RepositoryNameSet> r1(g1.repositories(env, x));
+ std::shared_ptr<const RepositoryNameSet> r2(g2.repositories(env, x));
std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
std::set_union(
r1->begin(), r1->end(),
@@ -592,10 +610,11 @@ namespace
virtual std::shared_ptr<const CategoryNamePartSet> categories(
const Environment * const env,
- const std::shared_ptr<const RepositoryNameSet> & repos) const
+ const std::shared_ptr<const RepositoryNameSet> & repos,
+ const RepositoryContentMayExcludes & x) const
{
- std::shared_ptr<const CategoryNamePartSet> c1(g1.categories(env, repos));
- std::shared_ptr<const CategoryNamePartSet> c2(g2.categories(env, repos));
+ std::shared_ptr<const CategoryNamePartSet> c1(g1.categories(env, repos, x));
+ std::shared_ptr<const CategoryNamePartSet> c2(g2.categories(env, repos, x));
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
std::set_union(
c1->begin(), c1->end(),
@@ -607,10 +626,11 @@ namespace
virtual std::shared_ptr<const QualifiedPackageNameSet> packages(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos,
- const std::shared_ptr<const CategoryNamePartSet> & cats) const
+ const std::shared_ptr<const CategoryNamePartSet> & cats,
+ const RepositoryContentMayExcludes & x) const
{
- std::shared_ptr<const QualifiedPackageNameSet> q1(g1.packages(env, repos, cats));
- std::shared_ptr<const QualifiedPackageNameSet> q2(g2.packages(env, repos, cats));
+ std::shared_ptr<const QualifiedPackageNameSet> q1(g1.packages(env, repos, cats, x));
+ std::shared_ptr<const QualifiedPackageNameSet> q2(g2.packages(env, repos, cats, x));
std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
std::set_union(
q1->begin(), q1->end(),
@@ -622,10 +642,11 @@ namespace
virtual std::shared_ptr<const PackageIDSet> ids(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos,
- const std::shared_ptr<const QualifiedPackageNameSet> & qpns) const
+ const std::shared_ptr<const QualifiedPackageNameSet> & qpns,
+ const RepositoryContentMayExcludes & x) const
{
- std::shared_ptr<const PackageIDSet> i1(g1.ids(env, repos, qpns));
- std::shared_ptr<const PackageIDSet> i2(g2.ids(env, repos, qpns));
+ std::shared_ptr<const PackageIDSet> i1(g1.ids(env, repos, qpns, x));
+ std::shared_ptr<const PackageIDSet> i2(g2.ids(env, repos, qpns, x));
std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
std::set_union(
i1->begin(), i1->end(),
@@ -655,7 +676,8 @@ namespace
AllGeneratorHandlerBase
{
virtual std::shared_ptr<const RepositoryNameSet> repositories(
- const Environment * const env) const
+ const Environment * const env,
+ const RepositoryContentMayExcludes &) const
{
std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
for (PackageDatabase::RepositoryConstIterator i(env->package_database()->begin_repositories()),
@@ -676,14 +698,16 @@ namespace
GeneratorHandler
{
virtual std::shared_ptr<const RepositoryNameSet> repositories(
- const Environment * const) const
+ const Environment * const,
+ const RepositoryContentMayExcludes &) const
{
return std::make_shared<RepositoryNameSet>();
}
virtual std::shared_ptr<const CategoryNamePartSet> categories(
const Environment * const,
- const std::shared_ptr<const RepositoryNameSet> &) const
+ const std::shared_ptr<const RepositoryNameSet> &,
+ const RepositoryContentMayExcludes &) const
{
return std::make_shared<CategoryNamePartSet>();
}
@@ -691,7 +715,8 @@ namespace
virtual std::shared_ptr<const QualifiedPackageNameSet> packages(
const Environment * const,
const std::shared_ptr<const RepositoryNameSet> &,
- const std::shared_ptr<const CategoryNamePartSet> &) const
+ const std::shared_ptr<const CategoryNamePartSet> &,
+ const RepositoryContentMayExcludes &) const
{
return std::make_shared<QualifiedPackageNameSet>();
}
@@ -699,7 +724,8 @@ namespace
virtual std::shared_ptr<const PackageIDSet> ids(
const Environment * const,
const std::shared_ptr<const RepositoryNameSet> &,
- const std::shared_ptr<const QualifiedPackageNameSet> &) const
+ const std::shared_ptr<const QualifiedPackageNameSet> &,
+ const RepositoryContentMayExcludes &) const
{
return std::make_shared<PackageIDSet>();
}
diff --git a/paludis/generator.hh b/paludis/generator.hh
index b4ee522..ff1f2e1 100644
--- a/paludis/generator.hh
+++ b/paludis/generator.hh
@@ -30,6 +30,7 @@
#include <paludis/package_id-fwd.hh>
#include <paludis/dep_spec-fwd.hh>
#include <paludis/match_package-fwd.hh>
+#include <paludis/repository-fwd.hh>
#include <memory>
/** \file
@@ -95,7 +96,8 @@ namespace paludis
* repositories for consideration.
*/
std::shared_ptr<const RepositoryNameSet> repositories(
- const Environment * const) const
+ const Environment * const,
+ const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
/**
@@ -104,7 +106,8 @@ namespace paludis
*/
std::shared_ptr<const CategoryNamePartSet> categories(
const Environment * const,
- const std::shared_ptr<const RepositoryNameSet> &) const
+ const std::shared_ptr<const RepositoryNameSet> &,
+ const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
/**
@@ -114,7 +117,8 @@ namespace paludis
std::shared_ptr<const QualifiedPackageNameSet> packages(
const Environment * const,
const std::shared_ptr<const RepositoryNameSet> &,
- const std::shared_ptr<const CategoryNamePartSet> &) const
+ const std::shared_ptr<const CategoryNamePartSet> &,
+ const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
/**
@@ -124,7 +128,8 @@ namespace paludis
std::shared_ptr<const PackageIDSet> ids(
const Environment * const,
const std::shared_ptr<const RepositoryNameSet> &,
- const std::shared_ptr<const QualifiedPackageNameSet> &) const
+ const std::shared_ptr<const QualifiedPackageNameSet> &,
+ const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
///\}
diff --git a/paludis/generator_handler.cc b/paludis/generator_handler.cc
index 73320ed..ec474a7 100644
--- a/paludis/generator_handler.cc
+++ b/paludis/generator_handler.cc
@@ -36,7 +36,8 @@ GeneratorHandler::~GeneratorHandler()
std::shared_ptr<const RepositoryNameSet>
AllGeneratorHandlerBase::repositories(
- const Environment * const env) const
+ const Environment * const env,
+ const RepositoryContentMayExcludes &) const
{
using namespace std::placeholders;
std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
@@ -48,14 +49,15 @@ AllGeneratorHandlerBase::repositories(
std::shared_ptr<const CategoryNamePartSet>
AllGeneratorHandlerBase::categories(
const Environment * const env,
- const std::shared_ptr<const RepositoryNameSet> & repos) const
+ const std::shared_ptr<const RepositoryNameSet> & repos,
+ const RepositoryContentMayExcludes & may_exclude) const
{
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
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(may_exclude));
std::copy(cats->begin(), cats->end(), result->inserter());
}
@@ -66,7 +68,8 @@ std::shared_ptr<const QualifiedPackageNameSet>
AllGeneratorHandlerBase::packages(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos,
- const std::shared_ptr<const CategoryNamePartSet> & cats) const
+ const std::shared_ptr<const CategoryNamePartSet> & cats,
+ const RepositoryContentMayExcludes & may_exclude) const
{
std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
@@ -77,7 +80,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, may_exclude));
std::copy(pkgs->begin(), pkgs->end(), result->inserter());
}
}
@@ -89,7 +92,8 @@ std::shared_ptr<const PackageIDSet>
AllGeneratorHandlerBase::ids(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos,
- const std::shared_ptr<const QualifiedPackageNameSet> & qpns) const
+ const std::shared_ptr<const QualifiedPackageNameSet> & qpns,
+ const RepositoryContentMayExcludes & may_exclude) const
{
std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
@@ -100,7 +104,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, may_exclude));
std::copy(i->begin(), i->end(), result->inserter());
}
}
diff --git a/paludis/generator_handler.hh b/paludis/generator_handler.hh
index c6f18fc..5a42da3 100644
--- a/paludis/generator_handler.hh
+++ b/paludis/generator_handler.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * 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
@@ -24,6 +24,7 @@
#include <paludis/name-fwd.hh>
#include <paludis/environment-fwd.hh>
#include <paludis/package_id-fwd.hh>
+#include <paludis/repository-fwd.hh>
#include <paludis/util/attributes.hh>
#include <memory>
@@ -36,24 +37,28 @@ namespace paludis
public:
virtual std::shared_ptr<const RepositoryNameSet> repositories(
- const Environment * const) const
+ const Environment * const,
+ const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
virtual std::shared_ptr<const CategoryNamePartSet> categories(
const Environment * const,
- const std::shared_ptr<const RepositoryNameSet> &) const
+ const std::shared_ptr<const RepositoryNameSet> &,
+ const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
virtual std::shared_ptr<const QualifiedPackageNameSet> packages(
const Environment * const,
const std::shared_ptr<const RepositoryNameSet> &,
- const std::shared_ptr<const CategoryNamePartSet> &) const
+ const std::shared_ptr<const CategoryNamePartSet> &,
+ const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
virtual std::shared_ptr<const PackageIDSet> ids(
const Environment * const,
const std::shared_ptr<const RepositoryNameSet> &,
- const std::shared_ptr<const QualifiedPackageNameSet> &) const
+ const std::shared_ptr<const QualifiedPackageNameSet> &,
+ const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
virtual std::string as_string() const = 0;
@@ -64,21 +69,25 @@ namespace paludis
{
public:
virtual std::shared_ptr<const RepositoryNameSet> repositories(
- const Environment * const env) const;
+ const Environment * const env,
+ const RepositoryContentMayExcludes &) const;
virtual std::shared_ptr<const CategoryNamePartSet> categories(
const Environment * const env,
- const std::shared_ptr<const RepositoryNameSet> & repos) const;
+ const std::shared_ptr<const RepositoryNameSet> & repos,
+ const RepositoryContentMayExcludes &) const;
virtual std::shared_ptr<const QualifiedPackageNameSet> packages(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos,
- const std::shared_ptr<const CategoryNamePartSet> & cats) const;
+ const std::shared_ptr<const CategoryNamePartSet> & cats,
+ const RepositoryContentMayExcludes &) const;
virtual std::shared_ptr<const PackageIDSet> ids(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos,
- const std::shared_ptr<const QualifiedPackageNameSet> & qpns) const;
+ const std::shared_ptr<const QualifiedPackageNameSet> & qpns,
+ const RepositoryContentMayExcludes &) const;
};
}
diff --git a/paludis/resolver/destination_utils.cc b/paludis/resolver/destination_utils.cc
index 1c16d63..2d28114 100644
--- a/paludis/resolver/destination_utils.cc
+++ b/paludis/resolver/destination_utils.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 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
@@ -60,7 +60,8 @@ namespace
AllGeneratorHandlerBase
{
virtual std::shared_ptr<const RepositoryNameSet> repositories(
- const Environment * const env) const
+ const Environment * const env,
+ const RepositoryContentMayExcludes &) const
{
using namespace std::placeholders;
std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
diff --git a/paludis/selection.cc b/paludis/selection.cc
index f2e5c85..06f7ff4 100644
--- a/paludis/selection.cc
+++ b/paludis/selection.cc
@@ -120,15 +120,15 @@ namespace
{
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
- std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env)));
+ std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env, { })));
if (r->empty())
return result;
- std::shared_ptr<const CategoryNamePartSet> c(_fg.filter().categories(env, r, _fg.generator().categories(env, r)));
+ std::shared_ptr<const CategoryNamePartSet> c(_fg.filter().categories(env, r, _fg.generator().categories(env, r, { })));
if (c->empty())
return result;
- std::shared_ptr<const QualifiedPackageNameSet> p(_fg.filter().packages(env, r, _fg.generator().packages(env, r, c)));
+ std::shared_ptr<const QualifiedPackageNameSet> p(_fg.filter().packages(env, r, _fg.generator().packages(env, r, c, { })));
if (p->empty())
return result;
@@ -136,7 +136,7 @@ namespace
{
std::shared_ptr<QualifiedPackageNameSet> s(std::make_shared<QualifiedPackageNameSet>());
s->insert(*q);
- std::shared_ptr<const PackageIDSet> i(_fg.filter().ids(env, _fg.generator().ids(env, r, s)));
+ std::shared_ptr<const PackageIDSet> i(_fg.filter().ids(env, _fg.generator().ids(env, r, s, { })));
if (! i->empty())
{
result->push_back(*i->begin());
@@ -168,15 +168,15 @@ namespace
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
- std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env)));
+ std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env, { })));
if (r->empty())
return result;
- std::shared_ptr<const CategoryNamePartSet> c(_fg.filter().categories(env, r, _fg.generator().categories(env, r)));
+ std::shared_ptr<const CategoryNamePartSet> c(_fg.filter().categories(env, r, _fg.generator().categories(env, r, { })));
if (c->empty())
return result;
- std::shared_ptr<const QualifiedPackageNameSet> p(_fg.filter().packages(env, r, _fg.generator().packages(env, r, c)));
+ std::shared_ptr<const QualifiedPackageNameSet> p(_fg.filter().packages(env, r, _fg.generator().packages(env, r, c, { })));
if (p->empty())
return result;
@@ -184,7 +184,7 @@ namespace
{
std::shared_ptr<QualifiedPackageNameSet> s(std::make_shared<QualifiedPackageNameSet>());
s->insert(*q);
- std::shared_ptr<const PackageIDSet> i(_fg.filter().ids(env, _fg.generator().ids(env, r, s)));
+ std::shared_ptr<const PackageIDSet> i(_fg.filter().ids(env, _fg.generator().ids(env, r, s, { })));
if (! i->empty())
result->push_back(*std::max_element(i->begin(), i->end(), PackageIDComparator(env->package_database().get())));
}
@@ -213,19 +213,19 @@ namespace
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
- std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env)));
+ std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env, { })));
if (r->empty())
return result;
- std::shared_ptr<const CategoryNamePartSet> c(_fg.filter().categories(env, r, _fg.generator().categories(env, r)));
+ std::shared_ptr<const CategoryNamePartSet> c(_fg.filter().categories(env, r, _fg.generator().categories(env, r, { })));
if (c->empty())
return result;
- std::shared_ptr<const QualifiedPackageNameSet> p(_fg.filter().packages(env, r, _fg.generator().packages(env, r, c)));
+ std::shared_ptr<const QualifiedPackageNameSet> p(_fg.filter().packages(env, r, _fg.generator().packages(env, r, c, { })));
if (p->empty())
return result;
- std::shared_ptr<const PackageIDSet> i(_fg.filter().ids(env, _fg.generator().ids(env, r, p)));
+ std::shared_ptr<const PackageIDSet> i(_fg.filter().ids(env, _fg.generator().ids(env, r, p, { })));
std::copy(i->begin(), i->end(), result->back_inserter());
result->sort(PackageIDComparator(env->package_database().get()));
@@ -253,19 +253,19 @@ namespace
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
- std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env)));
+ std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env, { })));
if (r->empty())
return result;
- std::shared_ptr<const CategoryNamePartSet> c(_fg.filter().categories(env, r, _fg.generator().categories(env, r)));
+ std::shared_ptr<const CategoryNamePartSet> c(_fg.filter().categories(env, r, _fg.generator().categories(env, r, { })));
if (c->empty())
return result;
- std::shared_ptr<const QualifiedPackageNameSet> p(_fg.filter().packages(env, r, _fg.generator().packages(env, r, c)));
+ std::shared_ptr<const QualifiedPackageNameSet> p(_fg.filter().packages(env, r, _fg.generator().packages(env, r, c, { })));
if (p->empty())
return result;
- std::shared_ptr<const PackageIDSet> i(_fg.filter().ids(env, _fg.generator().ids(env, r, p)));
+ std::shared_ptr<const PackageIDSet> i(_fg.filter().ids(env, _fg.generator().ids(env, r, p, { })));
std::copy(i->begin(), i->end(), result->back_inserter());
return result;
@@ -292,19 +292,19 @@ namespace
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
- std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env)));
+ std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env, { })));
if (r->empty())
return result;
- std::shared_ptr<const CategoryNamePartSet> c(_fg.filter().categories(env, r, _fg.generator().categories(env, r)));
+ std::shared_ptr<const CategoryNamePartSet> c(_fg.filter().categories(env, r, _fg.generator().categories(env, r, { })));
if (c->empty())
return result;
- std::shared_ptr<const QualifiedPackageNameSet> p(_fg.filter().packages(env, r, _fg.generator().packages(env, r, c)));
+ std::shared_ptr<const QualifiedPackageNameSet> p(_fg.filter().packages(env, r, _fg.generator().packages(env, r, c, { })));
if (p->empty())
return result;
- std::shared_ptr<const PackageIDSet> id(_fg.filter().ids(env, _fg.generator().ids(env, r, p)));
+ std::shared_ptr<const PackageIDSet> id(_fg.filter().ids(env, _fg.generator().ids(env, r, p, { })));
typedef std::map<std::pair<QualifiedPackageName, std::string>, std::shared_ptr<PackageIDSequence> > SlotMap;
SlotMap by_slot;
@@ -358,19 +358,19 @@ namespace
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
- std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env)));
+ std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env, { })));
if (r->empty())
return result;
- std::shared_ptr<const CategoryNamePartSet> c(_fg.filter().categories(env, r, _fg.generator().categories(env, r)));
+ std::shared_ptr<const CategoryNamePartSet> c(_fg.filter().categories(env, r, _fg.generator().categories(env, r, { })));
if (c->empty())
return result;
- std::shared_ptr<const QualifiedPackageNameSet> p(_fg.filter().packages(env, r, _fg.generator().packages(env, r, c)));
+ std::shared_ptr<const QualifiedPackageNameSet> p(_fg.filter().packages(env, r, _fg.generator().packages(env, r, c, { })));
if (p->empty())
return result;
- std::shared_ptr<const PackageIDSet> id(_fg.filter().ids(env, _fg.generator().ids(env, r, p)));
+ std::shared_ptr<const PackageIDSet> id(_fg.filter().ids(env, _fg.generator().ids(env, r, p, { })));
typedef std::map<std::pair<QualifiedPackageName, std::string>, std::shared_ptr<PackageIDSequence> > SlotMap;
SlotMap by_slot;
@@ -424,19 +424,19 @@ namespace
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
- std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env)));
+ std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env, { })));
if (r->empty())
throw DidNotGetExactlyOneError(as_string(), std::make_shared<PackageIDSet>());
- std::shared_ptr<const CategoryNamePartSet> c(_fg.filter().categories(env, r, _fg.generator().categories(env, r)));
+ std::shared_ptr<const CategoryNamePartSet> c(_fg.filter().categories(env, r, _fg.generator().categories(env, r, { })));
if (c->empty())
throw DidNotGetExactlyOneError(as_string(), std::make_shared<PackageIDSet>());
- std::shared_ptr<const QualifiedPackageNameSet> p(_fg.filter().packages(env, r, _fg.generator().packages(env, r, c)));
+ std::shared_ptr<const QualifiedPackageNameSet> p(_fg.filter().packages(env, r, _fg.generator().packages(env, r, c, { })));
if (p->empty())
throw DidNotGetExactlyOneError(as_string(), std::make_shared<PackageIDSet>());
- std::shared_ptr<const PackageIDSet> i(_fg.filter().ids(env, _fg.generator().ids(env, r, p)));
+ std::shared_ptr<const PackageIDSet> i(_fg.filter().ids(env, _fg.generator().ids(env, r, p, { })));
if (i->empty() || next(i->begin()) != i->end())
throw DidNotGetExactlyOneError(as_string(), i);