aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-28 16:39:54 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-28 16:50:38 +0000
commita07ecdba1a9d1ca3183ffdf03a1a5b2ec35f72d4 (patch)
treec93af113cdec30db563c6963810bd052954abb52
parent8bbc660636c3d5617c422d6d61084717ad7315ff (diff)
downloadpaludis-a07ecdba1a9d1ca3183ffdf03a1a5b2ec35f72d4.tar.gz
paludis-a07ecdba1a9d1ca3183ffdf03a1a5b2ec35f72d4.tar.xz
Use may_excludes in selections
-rw-r--r--paludis/selection.cc63
1 files changed, 35 insertions, 28 deletions
diff --git a/paludis/selection.cc b/paludis/selection.cc
index 06f7ff4..a5e11a7 100644
--- a/paludis/selection.cc
+++ b/paludis/selection.cc
@@ -119,16 +119,17 @@ namespace
virtual std::shared_ptr<PackageIDSequence> perform_select(const Environment * const env) const
{
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
+ RepositoryContentMayExcludes may_excludes(_fg.filter().may_excludes());
- 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, may_excludes)));
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, may_excludes)));
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, may_excludes)));
if (p->empty())
return result;
@@ -136,7 +137,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, may_excludes)));
if (! i->empty())
{
result->push_back(*i->begin());
@@ -167,16 +168,17 @@ namespace
using namespace std::placeholders;
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
+ RepositoryContentMayExcludes may_excludes(_fg.filter().may_excludes());
- 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, may_excludes)));
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, may_excludes)));
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, may_excludes)));
if (p->empty())
return result;
@@ -184,7 +186,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, may_excludes)));
if (! i->empty())
result->push_back(*std::max_element(i->begin(), i->end(), PackageIDComparator(env->package_database().get())));
}
@@ -212,20 +214,21 @@ namespace
using namespace std::placeholders;
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
+ RepositoryContentMayExcludes may_excludes(_fg.filter().may_excludes());
- 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, may_excludes)));
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, may_excludes)));
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, may_excludes)));
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, may_excludes)));
std::copy(i->begin(), i->end(), result->back_inserter());
result->sort(PackageIDComparator(env->package_database().get()));
@@ -252,20 +255,21 @@ namespace
using namespace std::placeholders;
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
+ RepositoryContentMayExcludes may_excludes(_fg.filter().may_excludes());
- 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, may_excludes)));
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, may_excludes)));
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, may_excludes)));
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, may_excludes)));
std::copy(i->begin(), i->end(), result->back_inserter());
return result;
@@ -291,20 +295,21 @@ namespace
using namespace std::placeholders;
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
+ RepositoryContentMayExcludes may_excludes(_fg.filter().may_excludes());
- 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, may_excludes)));
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, may_excludes)));
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, may_excludes)));
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, may_excludes)));
typedef std::map<std::pair<QualifiedPackageName, std::string>, std::shared_ptr<PackageIDSequence> > SlotMap;
SlotMap by_slot;
@@ -357,20 +362,21 @@ namespace
using namespace std::placeholders;
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
+ RepositoryContentMayExcludes may_excludes(_fg.filter().may_excludes());
- 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, may_excludes)));
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, may_excludes)));
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, may_excludes)));
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, may_excludes)));
typedef std::map<std::pair<QualifiedPackageName, std::string>, std::shared_ptr<PackageIDSequence> > SlotMap;
SlotMap by_slot;
@@ -423,20 +429,21 @@ namespace
using namespace std::placeholders;
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
+ RepositoryContentMayExcludes may_excludes(_fg.filter().may_excludes());
- 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, may_excludes)));
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, may_excludes)));
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, may_excludes)));
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, may_excludes)));
if (i->empty() || next(i->begin()) != i->end())
throw DidNotGetExactlyOneError(as_string(), i);